10000 UNIX Socket support for RedisArray · jrtkcoder/phpredis@eb236b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb236b8

Browse files
UNIX Socket support for RedisArray
1 parent 3ae7350 commit eb236b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

redis_array_impl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)
0