]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added counters for HTCP messages sent and received, reported in
authorwessels <>
Fri, 18 Jul 2003 04:22:49 +0000 (04:22 +0000)
committerwessels <>
Fri, 18 Jul 2003 04:22:49 +0000 (04:22 +0000)
'info' cache manager page.

doc/release-notes/release-3.0.sgml
src/htcp.cc
src/stat.cc
src/structs.h

index 98e582c9595bbc5492302b83184e0b3dd16cd9a1..61f9b62f2d31faa8d3e535ecb5329b5aabfe3721 100644 (file)
@@ -2,7 +2,7 @@
 <article>
 <title>Squid 3.0 release notes</title>
 <author>Squid Developers</author>
-<date>$Id: release-3.0.sgml,v 1.10 2003/07/15 20:45:36 wessels Exp $</date>
+<date>$Id: release-3.0.sgml,v 1.11 2003/07/17 22:22:49 wessels Exp $</date>
 
 <abstract>
 This document contains the release notes for version 3.0 of Squid.
@@ -125,6 +125,8 @@ This fixes two issues:<itemize><item>Transparently intercepted requests is no lo
  <item>external_acl extended with soft timeouts
  <item>external_acl can optionally return information to be logged in access.log
  <item>Requests denied due to 'http_reply_access' are now logged with TCP_DENIED_REPLY.
+ <item>Added counters for HTCP messages sent and received, reported
+       in 'info' cache manager page.
 </itemize>
 
 <sect>Changes to squid.conf
index 089f6955b393c93e15c406e646e75b5aa16bef70..67f22310afe1441301c64235468b82a785ddd649 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: htcp.cc,v 1.54 2003/07/15 06:50:42 robertc Exp $
+ * $Id: htcp.cc,v 1.55 2003/07/17 22:22:53 wessels Exp $
  *
  * DEBUG: section 31    Hypertext Caching Protocol
  * AUTHOR: Duane Wesssels
@@ -545,6 +545,8 @@ htcpSend(const char *buf, int len, struct sockaddr_in *to)
 
     if (x < 0)
         debug(31, 0) ("htcpSend: FD %d sendto: %s\n", htcpOutSocket, xstrerror());
+    else
+        statCounter.htcp.pkts_sent++;
 }
 
 /*
@@ -1130,7 +1132,12 @@ htcpRecv(int fd, void *data)
     len = comm_udp_recvfrom(fd, buf, 8192, 0, (struct sockaddr *) &from, &flen);
     debug(31, 3) ("htcpRecv: FD %d, %d bytes from %s:%d\n",
                   fd, len, inet_ntoa(from.sin_addr), ntohs(from.sin_port));
+
+    if (len)
+        statCounter.htcp.pkts_recv++;
+
     htcpHandle(buf, len, &from);
+
     commSetSelect(fd, COMM_SELECT_READ, htcpRecv, NULL, 0);
 }
 
index d1c3a98ccde286955bc29c744fa3416b9678a456..12a69619e77b5e8c34c87abab23774c29016c943 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.378 2003/07/11 01:40:37 robertc Exp $
+ * $Id: stat.cc,v 1.379 2003/07/17 22:22:53 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -490,6 +490,16 @@ info_get(StoreEntry * sentry)
     storeAppendPrintf(sentry, "\tNumber of queued ICP replies:\t%u\n",
                       statCounter.icp.replies_queued);
 
+#if USE_HTCP
+
+    storeAppendPrintf(sentry, "\tNumber of HTCP messages received:\t%u\n",
+                      statCounter.htcp.pkts_recv);
+
+    storeAppendPrintf(sentry, "\tNumber of HTCP messages sent:\t%u\n",
+                      statCounter.htcp.pkts_sent);
+
+#endif
+
     storeAppendPrintf(sentry, "\tRequest failure ratio:\t%5.2f\n",
                       request_failure_ratio);
 
index a5f609a4d5fe6e4af63d75b69281fb31ac9a6000..489933621f792cc41385bfa3337f521fbde206a7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.474 2003/07/15 11:33:22 robertc Exp $
+ * $Id: structs.h,v 1.475 2003/07/17 22:22:53 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -1796,6 +1796,14 @@ struct _StatCounters
 
     icp;
 
+    struct
+    {
+        int pkts_sent;
+        int pkts_recv;
+    }
+
+    htcp;
+
     struct
     {
         int requests;