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

Function cliSwitchProto

src/redis-cli.c:643–660  ·  view source on GitHub ↗

Select RESP3 mode if redis-cli was started with the -3 option. */

Source from the content-addressed store, hash-verified

641
642/* Select RESP3 mode if redis-cli was started with the -3 option. */
643static int cliSwitchProto(void) {
644 redisReply *reply;
645 if (config.resp3 == 0) return REDIS_OK;
646
647 reply = redisCommand(context,"HELLO 3");
648 if (reply == NULL) {
649 fprintf(stderr, "\nI/O error\n");
650 return REDIS_ERR;
651 }
652
653 int result = REDIS_OK;
654 if (reply->type == REDIS_REPLY_ERROR) {
655 result = REDIS_ERR;
656 fprintf(stderr,"HELLO 3 failed: %s\n",reply->str);
657 }
658 freeReplyObject(reply);
659 return result;
660}
661
662/* Connect to the server. It is possible to pass certain flags to the function:
663 * CC_FORCE: The connection is performed even if there is already

Callers 1

cliConnectFunction · 0.85

Calls 2

freeReplyObjectFunction · 0.85
redisCommandClass · 0.70

Tested by

no test coverage detected