MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cliFormatInvalidateTTY

Function cliFormatInvalidateTTY

app/redis-6.2.6/src/redis-cli.c:966–979  ·  view source on GitHub ↗

Special display handler for RESP3 'invalidate' messages. * This function does not validate the reply, so it should * already be confirmed correct */

Source from the content-addressed store, hash-verified

964 * This function does not validate the reply, so it should
965 * already be confirmed correct */
966static sds cliFormatInvalidateTTY(redisReply *r) {
967 sds out = sdsnew("-> invalidate: ");
968
969 for (size_t i = 0; i < r->element[1]->elements; i++) {
970 redisReply *key = r->element[1]->element[i];
971 assert(key->type == REDIS_REPLY_STRING);
972
973 out = sdscatfmt(out, "'%s'", key->str, key->len);
974 if (i < r->element[1]->elements - 1)
975 out = sdscatlen(out, ", ", 2);
976 }
977
978 return sdscatlen(out, "\n", 1);
979}
980
981static sds cliFormatReplyTTY(redisReply *r, char *prefix) {
982 sds out = sdsempty();

Callers 1

cliPushHandlerFunction · 0.85

Calls 3

sdsnewFunction · 0.85
sdscatfmtFunction · 0.85
sdscatlenFunction · 0.85

Tested by

no test coverage detected