Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7cb312

Browse files
author
Pepijn Verlaan
committed
Fix brpoplpush timeout reply handling
1 parent 93dae81 commit c7cb312

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

library.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,14 @@ PHPAPI char *redis_sock_read(RedisSock *redis_sock, int *buf_len TSRMLS_DC)
203203
resp = redis_sock_read_bulk_reply(redis_sock, *buf_len TSRMLS_CC);
204204
return resp;
205205

206+
case '*':
207+
/* For null multi-bulk replies (like timeouts from brpoplpush): */
208+
if(memcmp(inbuf + 1, "-1", 2) == 0) {
209+
return NULL;
210+
}
211+
/* fall through */
212+
206213
case '+':
207-
case '*':
208214
case ':':
209215
// Single Line Reply
210216
/* :123\r\n */

0 commit comments

Comments
 (0)