diff options
-rw-r--r-- | common.h | 2 | ||||
-rw-r--r-- | redis.c | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -246,7 +246,7 @@ typedef struct fold_item { typedef struct { php_stream *stream; zend_string *host; - short port; + unsigned short port; zend_string *auth; double timeout; double read_timeout; @@ -978,6 +978,10 @@ redis_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) port = 6379; } + if (port < 0) { + port = 0; + } + redis = PHPREDIS_GET_OBJECT(redis_object, object); /* if there is a redis sock already we have to remove it */ if (redis->sock) { |