diff options
author | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2012-09-09 23:38:30 +0400 |
---|---|---|
committer | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2012-09-09 23:38:30 +0400 |
commit | 6153477c4f71cbfadaae628e47ea022136f0131f (patch) | |
tree | 8eb1566c811254ded1ef29bdc7dd475d2a0dadcd /library.c | |
parent | 9eb217c061dbc60609f426b6fc365e0c3ef0580c (diff) |
Extend getLastError to all calls
Fixes GitHub issue #245.
Diffstat (limited to 'library.c')
-rw-r--r-- | library.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -172,6 +172,7 @@ PHPAPI char *redis_sock_read(RedisSock *redis_sock, int *buf_len TSRMLS_DC) { char inbuf[1024]; char *resp = NULL; + size_t err_len; if(-1 == redis_check_eof(redis_sock TSRMLS_CC)) { return NULL; @@ -189,6 +190,8 @@ PHPAPI char *redis_sock_read(RedisSock *redis_sock, int *buf_len TSRMLS_DC) switch(inbuf[0]) { case '-': + err_len = strlen(inbuf+1) - 2; + redis_sock_set_err(redis_sock, inbuf+1, err_len); /* stale data */ if(memcmp(inbuf + 1, "-ERR SYNC ", 10) == 0) { zend_throw_exception(redis_exception_ce, "SYNC with master in progress", 0 TSRMLS_CC); |