mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -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 {
|
} else {
|
||||||
obj = (void*)REDIS_REPLY_DOUBLE;
|
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 {
|
} else {
|
||||||
/* Type will be error or status. */
|
/* Type will be error or status. */
|
||||||
if (r->fn && r->fn->createString)
|
if (r->fn && r->fn->createString)
|
||||||
@ -493,6 +498,9 @@ static int processItem(redisReader *r) {
|
|||||||
case ',':
|
case ',':
|
||||||
cur->type = REDIS_REPLY_DOUBLE;
|
cur->type = REDIS_REPLY_DOUBLE;
|
||||||
break;
|
break;
|
||||||
|
case '_':
|
||||||
|
cur->type = REDIS_REPLY_NIL;
|
||||||
|
break;
|
||||||
case '$':
|
case '$':
|
||||||
cur->type = REDIS_REPLY_STRING;
|
cur->type = REDIS_REPLY_STRING;
|
||||||
break;
|
break;
|
||||||
@ -521,6 +529,7 @@ static int processItem(redisReader *r) {
|
|||||||
case REDIS_REPLY_STATUS:
|
case REDIS_REPLY_STATUS:
|
||||||
case REDIS_REPLY_INTEGER:
|
case REDIS_REPLY_INTEGER:
|
||||||
case REDIS_REPLY_DOUBLE:
|
case REDIS_REPLY_DOUBLE:
|
||||||
|
case REDIS_REPLY_NIL:
|
||||||
return processLineItem(r);
|
return processLineItem(r);
|
||||||
case REDIS_REPLY_STRING:
|
case REDIS_REPLY_STRING:
|
||||||
return processBulkItem(r);
|
return processBulkItem(r);
|
||||||
|
Loading…
Reference in New Issue
Block a user