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

Function clusterManagerGetNodeRedisInfo

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

Call "INFO" redis command on the specified node and return the reply. */

Source from the content-addressed store, hash-verified

2920
2921/* Call "INFO" redis command on the specified node and return the reply. */
2922static redisReply *clusterManagerGetNodeRedisInfo(clusterManagerNode *node,
2923 char **err)
2924{
2925 redisReply *info = CLUSTER_MANAGER_COMMAND(node, "INFO");
2926 if (err != NULL) *err = NULL;
2927 if (info == NULL) return NULL;
2928 if (info->type == REDIS_REPLY_ERROR) {
2929 if (err != NULL) {
2930 *err = zmalloc((info->len + 1) * sizeof(char));
2931 strcpy(*err, info->str);
2932 }
2933 freeReplyObject(info);
2934 return NULL;
2935 }
2936 return info;
2937}
2938
2939static int clusterManagerNodeIsCluster(clusterManagerNode *node, char **err) {
2940 redisReply *info = clusterManagerGetNodeRedisInfo(node, err);

Callers 2

Calls 2

zmallocFunction · 0.85
freeReplyObjectFunction · 0.85

Tested by

no test coverage detected