Skip to content

Commit

Permalink
fixup: improve comments for function parse_cluster_nodes_line
Browse files Browse the repository at this point in the history
Signed-off-by: Björn Svensson <[email protected]>
  • Loading branch information
bjosv committed Jan 15, 2025
1 parent bf60235 commit b09df8d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,11 +748,15 @@ static int store_replica_nodes(dict *nodes, dict *replicas) {
return VALKEY_OK;
}

/* Parse a node from a single CLUSTER NODES line. Returns an allocated
* valkeyClusterNode as a pointer in `parsed_node`.
/* Parse a node from a single CLUSTER NODES line.
* Returns VALKEY_OK and an allocated valkeyClusterNode as a pointer in
* `parsed_node`, or VALKEY_ERR when the parsing fails.
* Only parse primary nodes if the `parsed_primary_id` argument is NULL,
* otherwise replicas are also parsed and its primary_id is returned by pointer
* via 'parsed_primary_id'. */
* via 'parsed_primary_id'.
* The valkeyContext used when sending the CLUSTER NODES command should be
* provided in `c` since its destination IP address is used when no IP address
* is found in the parsed string. */
static int parse_cluster_nodes_line(valkeyClusterContext *cc, valkeyContext *c, char *line,
valkeyClusterNode **parsed_node, char **parsed_primary_id) {
char *p, *id = NULL, *addr = NULL, *flags = NULL, *primary_id = NULL,
Expand Down

0 comments on commit b09df8d

Please sign in to comment.