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>2011-11-04 01:15:32 +0400
committerNicolas Favre-Felix <n.favrefelix@gmail.com>2011-11-04 01:15:32 +0400
commitccc916df0b179c755dd43cfaada6ee7b9f40db63 (patch)
tree6dc149dcb9a31a5d97d3cd6c3e9fcd4446e24733 /library.c
parent78b81d8cbf986af04b8f917ab7f1b705d581e038 (diff)
Throw exception when master is syncing to slave.
This addresses GitHub issue #67.
Diffstat (limited to 'library.c')
-rw-r--r--library.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/library.c b/library.c
index a1fb87d1..2dd4c214 100644
--- a/library.c
+++ b/library.c
@@ -144,6 +144,10 @@ PHPAPI char *redis_sock_read(RedisSock *redis_sock, int *buf_len TSRMLS_DC)
switch(inbuf[0]) {
case '-':
+ /* stale data */
+ if(memcmp(inbuf + 1, "-ERR SYNC ", 10) == 0) {
+ zend_throw_exception(redis_exception_ce, "SYNC with master in progress", 0 TSRMLS_CC);
+ }
return NULL;
case '$':