Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Favre-Felix <n.favrefelix@gmail.com>2010-10-28 13:06:28 +0400
committerNicolas Favre-Felix <n.favrefelix@gmail.com>2010-10-28 13:06:28 +0400
commitda074dda313685679607f550a470ab97b5079b90 (patch)
tree0cb561cd8bae99f6520bd36a09461a8890f1e402
parent85e4746be9dda9e2332751141e10db7361dc5466 (diff)
Handle server death before close().2.0.9
-rw-r--r--library.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/library.c b/library.c
index 7a051504..407673e6 100644
--- a/library.c
+++ b/library.c
@@ -777,7 +777,9 @@ PHPAPI int redis_sock_disconnect(RedisSock *redis_sock TSRMLS_DC)
redis_sock_write(redis_sock, "QUIT", sizeof("QUIT") - 1 TSRMLS_CC);
redis_sock->status = REDIS_SOCK_STATUS_DISCONNECTED;
- php_stream_close(redis_sock->stream);
+ if(redis_sock->stream) { /* still valid after the write? */
+ php_stream_close(redis_sock->stream);
+ }
redis_sock->stream = NULL;
res = 1;