mirror of
https://github.com/fluencelabs/redis
synced 2025-03-18 16:40:50 +00:00
RESP3: module.c updated.
This commit is contained in:
parent
920611a419
commit
baf5b3f93a
12
src/module.c
12
src/module.c
@ -1123,10 +1123,10 @@ int RM_ReplyWithArray(RedisModuleCtx *ctx, long len) {
|
||||
ctx->postponed_arrays = zrealloc(ctx->postponed_arrays,sizeof(void*)*
|
||||
(ctx->postponed_arrays_count+1));
|
||||
ctx->postponed_arrays[ctx->postponed_arrays_count] =
|
||||
addDeferredMultiBulkLength(c);
|
||||
addReplyDeferredLen(c);
|
||||
ctx->postponed_arrays_count++;
|
||||
} else {
|
||||
addReplyMultiBulkLen(c,len);
|
||||
addReplyArrayLen(c,len);
|
||||
}
|
||||
return REDISMODULE_OK;
|
||||
}
|
||||
@ -1169,7 +1169,7 @@ void RM_ReplySetArrayLength(RedisModuleCtx *ctx, long len) {
|
||||
return;
|
||||
}
|
||||
ctx->postponed_arrays_count--;
|
||||
setDeferredMultiBulkLength(c,
|
||||
setDeferredArrayLen(c,
|
||||
ctx->postponed_arrays[ctx->postponed_arrays_count],
|
||||
len);
|
||||
if (ctx->postponed_arrays_count == 0) {
|
||||
@ -1205,7 +1205,7 @@ int RM_ReplyWithString(RedisModuleCtx *ctx, RedisModuleString *str) {
|
||||
int RM_ReplyWithNull(RedisModuleCtx *ctx) {
|
||||
client *c = moduleGetReplyClient(ctx);
|
||||
if (c == NULL) return REDISMODULE_OK;
|
||||
addReply(c,shared.nullbulk);
|
||||
addReplyNull(c);
|
||||
return REDISMODULE_OK;
|
||||
}
|
||||
|
||||
@ -4868,11 +4868,11 @@ NULL
|
||||
dictIterator *di = dictGetIterator(modules);
|
||||
dictEntry *de;
|
||||
|
||||
addReplyMultiBulkLen(c,dictSize(modules));
|
||||
addReplyArrayLen(c,dictSize(modules));
|
||||
while ((de = dictNext(di)) != NULL) {
|
||||
sds name = dictGetKey(de);
|
||||
struct RedisModule *module = dictGetVal(de);
|
||||
addReplyMultiBulkLen(c,4);
|
||||
addReplyMapLen(c,2);
|
||||
addReplyBulkCString(c,"name");
|
||||
addReplyBulkCBuffer(c,name,sdslen(name));
|
||||
addReplyBulkCString(c,"ver");
|
||||
|
Loading…
x
Reference in New Issue
Block a user