@@ -36,7 +36,7 @@ ra_load_hosts(RedisArray *ra, HashTable *hosts, long retry_interval TSRMLS_DC)
36
36
int count = zend_hash_num_elements (hosts );
37
37
char * host , * p ;
38
38
short port ;
39
- zval * * zpData , z_cons , z_ret ;
39
+ zval * * zpData , * z_args , z_cons , z_ret ;
40
40
RedisSock * redis_sock = NULL ;
41
41
42
42
/* function calls on the Redis object */
@@ -59,7 +59,9 @@ ra_load_hosts(RedisArray *ra, HashTable *hosts, long retry_interval TSRMLS_DC)
59
59
if ((p = strchr (host , ':' ))) { /* found port */
60
60
host_len = p - host ;
61
61
port = (short )atoi (p + 1 );
62
- }
62
+ } else if (strchr (host ,'/' ) != NULL ) { /* unix socket */
63
+ port = -1 ;
64
+ }
63
65
64
66
/* create Redis object */
65
67
MAKE_STD_ZVAL (ra -> redis [i ]);
@@ -68,7 +70,7 @@ ra_load_hosts(RedisArray *ra, HashTable *hosts, long retry_interval TSRMLS_DC)
68
70
call_user_function (& redis_ce -> function_table , & ra -> redis [i ], & z_cons , & z_ret , 0 , NULL TSRMLS_CC );
69
71
70
72
/* create socket */
71
- redis_sock = redis_sock_create (host , host_len , port , 0 , 0 , NULL , retry_interval ); /* TODO: persistence? */
73
+ redis_sock = redis_sock_create (host , host_len , port , 0 , ra -> pconnect , NULL , retry_interval );
72
74
73
75
/* connect */
74
76
redis_sock_server_open (redis_sock , 1 TSRMLS_CC );
0 commit comments