Call "INFO" redis command on the specified node and return the reply. */
| 2631 | |
| 2632 | /* Call "INFO" redis command on the specified node and return the reply. */ |
| 2633 | static redisReply *clusterManagerGetNodeRedisInfo(clusterManagerNode *node, |
| 2634 | char **err) |
| 2635 | { |
| 2636 | redisReply *info = CLUSTER_MANAGER_COMMAND(node, "INFO"); |
| 2637 | if (err != NULL) *err = NULL; |
| 2638 | if (info == NULL) return NULL; |
| 2639 | if (info->type == REDIS_REPLY_ERROR) { |
| 2640 | if (err != NULL) { |
| 2641 | *err = zmalloc((info->len + 1) * sizeof(char), MALLOC_LOCAL); |
| 2642 | strcpy(*err, info->str); |
| 2643 | } |
| 2644 | freeReplyObject(info); |
| 2645 | return NULL; |
| 2646 | } |
| 2647 | return info; |
| 2648 | } |
| 2649 | |
| 2650 | static int clusterManagerNodeIsCluster(clusterManagerNode *node, char **err) { |
| 2651 | redisReply *info = clusterManagerGetNodeRedisInfo(node, err); |
no test coverage detected