Revision: 14557
Author: [email protected]
Date: Fri Apr  9 17:31:11 2010
Log: Issue #104 - fix address printing in fdRemoteAddr()
http://code.google.com/p/lusca-cache/source/detail?r=14557

Modified:
 /branches/LUSCA_HEAD/src/stat.c

=======================================
--- /branches/LUSCA_HEAD/src/stat.c     Mon Oct 26 23:58:33 2009
+++ /branches/LUSCA_HEAD/src/stat.c     Fri Apr  9 17:31:11 2010
@@ -427,8 +427,10 @@
     if (*f->ipaddrstr)
snprintf(buf, SQUIDHOSTNAMELEN, "%s.%d", f->ipaddrstr, (int) f->remote_port);
     else {
-       if (sqinet_is_anyaddr(&f->local_address)) {
- snprintf(buf, SQUIDHOSTNAMELEN, "%s.%d", inet_ntoa(sqinet_get_v4_inaddr(&f->local_address, SQADDR_ASSERT_IS_V4)), (int) f->local_port);
+       if (!sqinet_is_anyaddr(&f->local_address)) {
+           char s[MAX_IPSTRLEN];
+           sqinet_ntoa(&f->local_address, s, sizeof(s), 0);
+           snprintf(buf, SQUIDHOSTNAMELEN, "%s.%d", s, (int) f->local_port);
        } else {
            snprintf(buf, SQUIDHOSTNAMELEN, "*.%d", (int) f->local_port);
        }

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to