MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / announceSentinelAddrAndPort

Function announceSentinelAddrAndPort

src/sentinel.cpp:662–668  ·  view source on GitHub ↗

Return an allocated sds with hostname/address:port. IPv6 * addresses are bracketed the same way anetFormatAddr() does. */

Source from the content-addressed store, hash-verified

660 * addresses are bracketed the same way anetFormatAddr() does.
661 */
662sds announceSentinelAddrAndPort(const sentinelAddr *a) {
663 const char *addr = announceSentinelAddr(a);
664 if (strchr(addr, ':') != NULL)
665 return sdscatprintf(sdsempty(), "[%s]:%d", addr, a->port);
666 else
667 return sdscatprintf(sdsempty(), "%s:%d", addr, a->port);
668}
669
670/* =========================== Events notification ========================== */
671

Callers 2

Calls 3

announceSentinelAddrFunction · 0.85
sdscatprintfFunction · 0.85
sdsemptyFunction · 0.85

Tested by

no test coverage detected