Ends a dict field, see RedisModule_InfoBeginDictField */
| 7144 | |
| 7145 | /* Ends a dict field, see RedisModule_InfoBeginDictField */ |
| 7146 | int RM_InfoEndDictField(RedisModuleInfoCtx *ctx) { |
| 7147 | if (!ctx->in_dict_field) |
| 7148 | return REDISMODULE_ERR; |
| 7149 | /* trim the last ',' if found. */ |
| 7150 | if (ctx->info[sdslen(ctx->info)-1]==',') |
| 7151 | sdsIncrLen(ctx->info, -1); |
| 7152 | ctx->info = sdscat(ctx->info, "\r\n"); |
| 7153 | ctx->in_dict_field = 0; |
| 7154 | return REDISMODULE_OK; |
| 7155 | } |
| 7156 | |
| 7157 | /* Used by RedisModuleInfoFunc to add info fields. |
| 7158 | * Each field will be automatically prefixed by `<modulename>_`. |
no test coverage detected