Return an allocated sds with hostname/address:port. IPv6 * addresses are bracketed the same way anetFormatAddr() does. */
| 660 | * addresses are bracketed the same way anetFormatAddr() does. |
| 661 | */ |
| 662 | sds 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 |
no test coverage detected