Skip to content

Commit 9847ef9

Browse files
committed
Fix jsonMetaPrefix
1 parent c444094 commit 9847ef9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ext/handlersToJson.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static RdbRes toJsonDbSize(RdbParser *p, void *userData, uint64_t db_size, uint6
153153
}
154154

155155
/* output json part */
156-
fprintf(ctx->outfile, " \"__dbsize__\": {\n");
156+
fprintf(ctx->outfile, " \"%sdbsize__\": {\n", jsonMetaPrefix); /* group dbsize with {..} */
157157
fprintf(ctx->outfile, " \"size\": %" PRIu64 ",\n", db_size);
158158
fprintf(ctx->outfile, " \"expires\": %" PRIu64 "\n", exp_size);
159159
fprintf(ctx->outfile, " }%s\n", (db_size) ? "," : "");
@@ -171,7 +171,7 @@ static RdbRes toJsonSlotInfo(RdbParser *p, void *userData, RdbSlotInfo *info) {
171171
}
172172

173173
/* output json part */
174-
fprintf(ctx->outfile, " \"__slotinfo__\": {\n");
174+
fprintf(ctx->outfile, " \"%sslotinfo__\": {\n", jsonMetaPrefix);
175175
fprintf(ctx->outfile, " \"slotId\": %lu,\n", info->slot_id);
176176
fprintf(ctx->outfile, " \"slotSize\": %lu,\n", info->slot_size);
177177
fprintf(ctx->outfile, " \"slotSExpiresSize\": %lu\n", info->expires_slot_size);
@@ -184,7 +184,7 @@ static RdbRes toJsonAuxField(RdbParser *p, void *userData, RdbBulk auxkey, RdbBu
184184

185185
if (ctx->state == R2J_IDLE) {
186186
ctx->state = R2J_AUX_FIELDS;
187-
fprintf(ctx->outfile, "\"__aux__\" : {\n "); /* group aux-fields with { ... } */
187+
fprintf(ctx->outfile, " \"%saux__\": {\n", jsonMetaPrefix); /* group aux-fields with {..} */
188188
} else if (ctx->state == R2J_AUX_FIELDS) {
189189
fprintf(ctx->outfile, ",\n ");
190190
} else {
@@ -500,9 +500,9 @@ static RdbRes toJsonFunction(RdbParser *p, void *userData, RdbBulk func) {
500500

501501
if (ctx->state == R2J_IDLE) {
502502
ctx->state = R2J_FUNCTIONS;
503-
fprintf(ctx->outfile, "\"__func__\": {\n");
503+
fprintf(ctx->outfile, "\"%sfunc__\": {\n", jsonMetaPrefix);
504504
} else if (ctx->state == R2J_AUX_FIELDS) {
505-
fprintf(ctx->outfile, "\n},\n \"__func__\": {\n");
505+
fprintf(ctx->outfile, "\n},\n \"%sfunc__\": {\n", jsonMetaPrefix);
506506
ctx->state = R2J_FUNCTIONS;
507507
} else if (ctx->state == R2J_FUNCTIONS) {
508508
fprintf(ctx->outfile, ",\n");

0 commit comments

Comments
 (0)