8000 Fix host|file condition in session backend. · jrtkcoder/phpredis@f3dff08 · GitHub
[go: up one dir, main page]

Skip to content

Commit f3dff08

Browse files
committed
Fix host|file condition in session backend.
Should address phpredis#184. Adding a slash at the end would make phpredis consider "/" as the path and ignore the host. Having a host name now takes precedence over having a file name.
1 parent a568029 commit f3dff08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

redis_session.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ PS_OPEN_FUNC(redis)
251251
}
252252

253253
RedisSock *redis_sock;
254-
if(url->path) { /* unix */
255-
redis_sock = redis_sock_create(url->path, strlen(url->path), 0, timeout, persistent, persistent_id);
256-
} else {
254+
if(url->host) {
257255
redis_sock = redis_sock_create(url->host, strlen(url->host), url->port, timeout, persistent, persistent_id);
256+
} else { /* unix */
257+
redis_sock = redis_sock_create(url->path, strlen(url->path), 0, timeout, persistent, persistent_id);
258258
}
259259
redis_pool_add(pool, redis_sock, weight, prefix, auth TSRMLS_CC);
260260

0 commit comments

Comments
 (0)
0