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

Function parseClusterNodeAddress

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

Source from the content-addressed store, hash-verified

2610}
2611
2612static int parseClusterNodeAddress(char *addr, char **ip_ptr, int *port_ptr,
2613 int *bus_port_ptr)
2614{
2615 char *c = strrchr(addr, '@');
2616 if (c != NULL) {
2617 *c = '\0';
2618 if (bus_port_ptr != NULL)
2619 *bus_port_ptr = atoi(c + 1);
2620 }
2621 c = strrchr(addr, ':');
2622 if (c != NULL) {
2623 *c = '\0';
2624 *ip_ptr = addr;
2625 *port_ptr = atoi(++c);
2626 } else return 0;
2627 return 1;
2628}
2629
2630/* Get host ip and port from command arguments. If only one argument has
2631 * been provided it must be in the form of 'ip:port', elsewhere

Callers 2

Calls 1

strrchrFunction · 0.85

Tested by

no test coverage detected