MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / cliFormatInvalidateTTY

Function cliFormatInvalidateTTY

src/redis-cli.c:773–786  ·  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

771 * This function does not validate the reply, so it should
772 * already be confirmed correct */
773static sds cliFormatInvalidateTTY(redisReply *r) {
774 sds out = sdsnew("-> invalidate: ");
775
776 for (size_t i = 0; i < r->element[1]->elements; i++) {
777 redisReply *key = r->element[1]->element[i];
778 assert(key->type == REDIS_REPLY_STRING);
779
780 out = sdscatfmt(out, "'%s'", key->str, key->len);
781 if (i < r->element[1]->elements - 1)
782 out = sdscatlen(out, ", ", 2);
783 }
784
785 return sdscatlen(out, "\n", 1);
786}
787
788static sds cliFormatReplyTTY(redisReply *r, char *prefix) {
789 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