summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-11-24 15:21:34 +0100
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-11-24 15:21:34 +0100
commitd4058be7b0864a3c8862fb38a4567579aca7a8e9 (patch)
tree2233333abc66fd21359d8b76495d37a9e8e723f2
parent3d702d0bf1191e8787757b176c55248f367e482b (diff)
Add pointer to parent task in read tasks
-rw-r--r--hiredis.c3
-rw-r--r--hiredis.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/hiredis.c b/hiredis.c
index 32aad43..5888dd3 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -313,6 +313,7 @@ static int processMultiBulkItem(redisReader *r) {
r->rstack[r->ridx].type = -1;
r->rstack[r->ridx].elements = -1;
r->rstack[r->ridx].parent = obj;
+ r->rstack[r->ridx].parentTask = cur;
r->rstack[r->ridx].idx = 0;
r->rstack[r->ridx].privdata = r->privdata;
} else {
@@ -471,7 +472,7 @@ int redisReplyReaderGetReply(void *reader, void **reply) {
if (r->ridx == -1) {
r->rstack[0].type = -1;
r->rstack[0].elements = -1;
- r->rstack[0].parent = NULL;
+ r->rstack[0].parent = r->rstack[0].parentTask = NULL;
r->rstack[0].idx = -1;
r->rstack[0].privdata = r->privdata;
r->ridx = 0;
diff --git a/hiredis.h b/hiredis.h
index 5065043..665b8c6 100644
--- a/hiredis.h
+++ b/hiredis.h
@@ -88,6 +88,7 @@ typedef struct redisReadTask {
int elements; /* number of elements in multibulk container */
void *parent; /* optional pointer to parent object */
int idx; /* index in parent (array) object */
+ struct redisReadTask *parentTask; /* pointer to parent task */
void *privdata; /* user-settable arbitrary field */
} redisReadTask;