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

Function cliSwitchProto

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

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

Source from the content-addressed store, hash-verified

834
835/* Select RESP3 mode if redis-cli was started with the -3 option. */
836static int cliSwitchProto(void) {
837 redisReply *reply;
838 if (config.resp3 == 0) return REDIS_OK;
839
840 reply = redisCommand(context,"HELLO 3");
841 if (reply == NULL) {
842 fprintf(stderr, "\nI/O error\n");
843 return REDIS_ERR;
844 }
845
846 int result = REDIS_OK;
847 if (reply->type == REDIS_REPLY_ERROR) {
848 result = REDIS_ERR;
849 fprintf(stderr,"HELLO 3 failed: %s\n",reply->str);
850 }
851 freeReplyObject(reply);
852 return result;
853}
854
855/* Connect to the server. It is possible to pass certain flags to the function:
856 * 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