summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2013-07-10 21:08:15 -0700
committerPieter Noordhuis <pcnoordhuis@gmail.com>2013-07-10 21:08:15 -0700
commitaf9bf16953b2e559ec7ecd12a25d5ea97b879bb2 (patch)
tree4568bbe03818628b71bf7937c14b4676b8bd9bee
parentfc55afb1b672bd3e4f47c3befdcf782013fedac3 (diff)
Call aeStop on error conditions
-rw-r--r--example-ae.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/example-ae.c b/example-ae.c
index 0484a73..93f1a84 100644
--- a/example-ae.c
+++ b/example-ae.c
@@ -21,18 +21,21 @@ void getCallback(redisAsyncContext *c, void *r, void *privdata) {
void connectCallback(const redisAsyncContext *c, int status) {
if (status != REDIS_OK) {
printf("Error: %s\n", c->errstr);
+ aeStop(loop);
return;
}
+
printf("Connected...\n");
}
void disconnectCallback(const redisAsyncContext *c, int status) {
if (status != REDIS_OK) {
printf("Error: %s\n", c->errstr);
+ aeStop(loop);
return;
}
- printf("Disconnected...\n");
+ printf("Disconnected...\n");
aeStop(loop);
}