Call "INFO" redis command on the specified node and return the reply. */
| 2920 | |
| 2921 | /* Call "INFO" redis command on the specified node and return the reply. */ |
| 2922 | static 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 | |
| 2939 | static int clusterManagerNodeIsCluster(clusterManagerNode *node, char **err) { |
| 2940 | redisReply *info = clusterManagerGetNodeRedisInfo(node, err); |
no test coverage detected