Permalink
Browse files

Fix host|file condition in session backend.

Should address #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.
  • Loading branch information...
1 parent a568029 commit f3dff08cfaf5d6a7a78bd87e70ee19c92f0ad27d @nicolasff nicolasff committed Jul 9, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 redis_session.c
View
@@ -251,10 +251,10 @@ PS_OPEN_FUNC(redis)
}
RedisSock *redis_sock;
- if(url->path) { /* unix */
- redis_sock = redis_sock_create(url->path, strlen(url->path), 0, timeout, persistent, persistent_id);
- } else {
+ if(url->host) {
redis_sock = redis_sock_create(url->host, strlen(url->host), url->port, timeout, persistent, persistent_id);
+ } else { /* unix */
+ redis_sock = redis_sock_create(url->path, strlen(url->path), 0, timeout, persistent, persistent_id);
}
redis_pool_add(pool, redis_sock, weight, prefix, auth TSRMLS_CC);

0 comments on commit f3dff08

Please sign in to comment.