mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
RESP3: hiredis: implement null type.
This commit is contained in:
parent
b8134dbfa7
commit
ee4c355a3e
9
deps/hiredis/read.c
vendored
9
deps/hiredis/read.c
vendored
@ -308,6 +308,11 @@ static int processLineItem(redisReader *r) {
|
||||
} else {
|
||||
obj = (void*)REDIS_REPLY_DOUBLE;
|
||||
}
|
||||
} else if (cur->type == REDIS_REPLY_NIL) {
|
||||
if (r->fn && r->fn->createNil)
|
||||
obj = r->fn->createNil(cur);
|
||||
else
|
||||
obj = (void*)REDIS_REPLY_NIL;
|
||||
} else {
|
||||
/* Type will be error or status. */
|
||||
if (r->fn && r->fn->createString)
|
||||
@ -493,6 +498,9 @@ static int processItem(redisReader *r) {
|
||||
case ',':
|
||||
cur->type = REDIS_REPLY_DOUBLE;
|
||||
break;
|
||||
case '_':
|
||||
cur->type = REDIS_REPLY_NIL;
|
||||
break;
|
||||
case '$':
|
||||
cur->type = REDIS_REPLY_STRING;
|
||||
break;
|
||||
@ -521,6 +529,7 @@ static int processItem(redisReader *r) {
|
||||
case REDIS_REPLY_STATUS:
|
||||
case REDIS_REPLY_INTEGER:
|
||||
case REDIS_REPLY_DOUBLE:
|
||||
case REDIS_REPLY_NIL:
|
||||
return processLineItem(r);
|
||||
case REDIS_REPLY_STRING:
|
||||
return processBulkItem(r);
|
||||
|
Loading…
Reference in New Issue
Block a user