@@ -35,7 +35,7 @@ ra_load_hosts(RedisArray *ra, HashTable *hosts TSRMLS_DC)
3535 int count = zend_hash_num_elements (hosts );
3636 char * host , * p ;
3737 short port ;
38- zval * * zpData , z_cons , * z_args , z_ret ;
38+ zval * * zpData , z_cons , z_ret ;
3939 RedisSock * redis_sock = NULL ;
4040
4141 /* function calls on the Redis object */
@@ -58,6 +58,8 @@ ra_load_hosts(RedisArray *ra, HashTable *hosts TSRMLS_DC)
5858 if ((p = strchr (host , ':' ))) { /* found port */
5959 host_len = p - host ;
6060 port = (short )atoi (p + 1 );
61+ } else if (strchr (host ,'/' ) != NULL ) { /* redis socket */
62+ port = -1 ;
6163 }
6264
6365 /* create Redis object */
@@ -67,7 +69,7 @@ ra_load_hosts(RedisArray *ra, HashTable *hosts TSRMLS_DC)
6769 call_user_function (& redis_ce -> function_table , & ra -> redis [i ], & z_cons , & z_ret , 0 , NULL TSRMLS_CC );
6870
6971 /* create socket */
70- redis_sock = redis_sock_create (host , host_len , port , 0 , ra -> pconnect , NULL ); /* TODO: persistence? */
72+ redis_sock = redis_sock_create (host , host_len , port , 0 , ra -> pconnect , NULL );
7173
7274 /* connect */
7375 redis_sock_server_open (redis_sock , 1 TSRMLS_CC );
0 commit comments