Return from getCallback if there is no reply

This commit is contained in:
Pieter Noordhuis 2010-11-01 11:11:43 +01:00
parent e16340f2db
commit b028dda359
3 changed files with 4 additions and 2 deletions

View File

@ -58,10 +58,10 @@ dynamic: ${DYLIBNAME}
static: ${STLIBNAME}
# Binaries:
hiredis-example-libevent: ${DYLIBNAME}
hiredis-example-libevent: example-libevent.o ${DYLIBNAME}
$(CC) -o $@ $(CCOPT) $(DEBUG) -L. -lhiredis -levent -Wl,-rpath,. example-libevent.c
hiredis-example-libev: ${DYLIBNAME}
hiredis-example-libev: example-libev.o ${DYLIBNAME}
$(CC) -o $@ $(CCOPT) $(DEBUG) -L. -lhiredis -lev -Wl,-rpath,. example-libev.c
hiredis-%: %.o ${DYLIBNAME}

View File

@ -7,6 +7,7 @@
#include "adapters/libev.h"
void getCallback(redisAsyncContext *c, redisReply *reply, void *privdata) {
if (reply == NULL) return;
printf("argv[%s]: %s\n", (char*)privdata, reply->str);
/* Disconnect after receiving the reply to GET */

View File

@ -7,6 +7,7 @@
#include "adapters/libevent.h"
void getCallback(redisAsyncContext *c, redisReply *reply, void *privdata) {
if (reply == NULL) return;
printf("argv[%s]: %s\n", (char*)privdata, reply->str);
/* Disconnect after receiving the reply to GET */