--------------------- PatchSet 11728 Date: 2007/10/15 23:53:17 Author: hno Branch: HEAD Tag: (none) Log: Show local address on listening sockets Members: src/stat.c:1.381->1.382 Index: squid/src/stat.c =================================================================== RCS file: /cvsroot/squid/squid/src/stat.c,v retrieving revision 1.381 retrieving revision 1.382 diff -u -r1.381 -r1.382 --- squid/src/stat.c 20 Sep 2007 20:22:00 -0000 1.381 +++ squid/src/stat.c 15 Oct 2007 23:53:17 -0000 1.382 @@ -1,6 +1,6 @@ /* - * $Id: stat.c,v 1.381 2007/09/20 20:22:00 hno Exp $ + * $Id: stat.c,v 1.382 2007/10/15 23:53:17 hno Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -421,7 +421,15 @@ LOCAL_ARRAY(char, buf, 32); if (f->type != FD_SOCKET) return null_string; - snprintf(buf, 32, "%s.%d", f->ipaddr, (int) f->remote_port); + if (*f->ipaddr) + snprintf(buf, 32, "%s.%d", f->ipaddr, (int) f->remote_port); + else { + if (f->local_addr.s_addr != any_addr.s_addr) { + snprintf(buf, 32, "%s.%d", inet_ntoa(f->local_addr), (int) f->local_port); + } else { + snprintf(buf, 32, "*.%d", (int) f->local_port); + } + } return buf; }