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:
authorPepijn Verlaan <pepijnverlaan@yahoo.com>2012-11-16 12:53:19 +0400
committerPepijn Verlaan <pepijnverlaan@yahoo.com>2012-11-16 12:53:19 +0400
commitc7cb3123456792415857389c77f18f3518b1baeb (patch)
tree53c3701379f84b8a7d1a8db616ca0faaf0713afa /library.c
parent93dae810ce8e1606b90ebee3117efbffa75ffc29 (diff)
Fix brpoplpush timeout reply handling
Diffstat (limited to 'library.c')
-rw-r--r--library.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/library.c b/library.c
index 6a93f490..92e3de4c 100644
--- a/library.c
+++ b/library.c
@@ -203,8 +203,14 @@ PHPAPI char *redis_sock_read(RedisSock *redis_sock, int *buf_len TSRMLS_DC)
resp = redis_sock_read_bulk_reply(redis_sock, *buf_len TSRMLS_CC);
return resp;
+ case '*':
+ /* For null multi-bulk replies (like timeouts from brpoplpush): */
+ if(memcmp(inbuf + 1, "-1", 2) == 0) {
+ return NULL;
+ }
+ /* fall through */
+
case '+':
- case '*':
case ':':
// Single Line Reply
/* :123\r\n */