Ends a dict field, see RedisModule_InfoBeginDictField */
| 6952 | |
| 6953 | /* Ends a dict field, see RedisModule_InfoBeginDictField */ |
| 6954 | int RM_InfoEndDictField(RedisModuleInfoCtx *ctx) { |
| 6955 | if (!ctx->in_dict_field) |
| 6956 | return REDISMODULE_ERR; |
| 6957 | /* trim the last ',' if found. */ |
| 6958 | if (ctx->info[sdslen(ctx->info)-1]==',') |
| 6959 | sdsIncrLen(ctx->info, -1); |
| 6960 | ctx->info = sdscat(ctx->info, "\r\n"); |
| 6961 | ctx->in_dict_field = 0; |
| 6962 | return REDISMODULE_OK; |
| 6963 | } |
| 6964 | |
| 6965 | /* Used by RedisModuleInfoFunc to add info fields. |
| 6966 | * Each field will be automatically prefixed by `<modulename>_`. |
no test coverage detected