diff options
author | antirez <antirez@gmail.com> | 2014-09-18 17:37:05 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2014-09-18 17:37:40 +0200 |
commit | 747b57cfb66abf2baafa372e312298c037248f1c (patch) | |
tree | 9333dddd1767b61cf53f851ca62c58830d95fc89 /src/anet.c | |
parent | 6d53b2f34b16a4fcd0602cb47cb58c31bd28b9e0 (diff) | |
download | redis-747b57cfb66abf2baafa372e312298c037248f1c.tar.gz |
anetPeerToString(): make unix sockets distinguishable.
Following the CLIENT LIST output format, we prefix the unix socket
address with a "/" so that it is different than an IPv4/6 address.
This makes parsing simpler.
Related to #2010.
Diffstat (limited to 'src/anet.c')
-rw-r--r-- | src/anet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/anet.c b/src/anet.c index 53656eca0..e3c155940 100644 --- a/src/anet.c +++ b/src/anet.c @@ -541,7 +541,7 @@ int anetPeerToString(int fd, char *ip, size_t ip_len, int *port) { if (ip) inet_ntop(AF_INET6,(void*)&(s->sin6_addr),ip,ip_len); if (port) *port = ntohs(s->sin6_port); } else if (sa.ss_family == AF_UNIX) { - if (ip) strncpy(ip,"unixsocket",ip_len); + if (ip) strncpy(ip,"/unixsocket",ip_len); if (port) *port = 0; } else { goto error; |