From: wessels <> Date: Fri, 18 Jul 2003 04:22:49 +0000 (+0000) Subject: Added counters for HTCP messages sent and received, reported in X-Git-Tag: SQUID_3_0_PRE2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4ebc8302794bca323611dbc98cb783adaeca286;p=thirdparty%2Fsquid.git Added counters for HTCP messages sent and received, reported in 'info' cache manager page. --- diff --git a/doc/release-notes/release-3.0.sgml b/doc/release-notes/release-3.0.sgml index 98e582c959..61f9b62f2d 100644 --- a/doc/release-notes/release-3.0.sgml +++ b/doc/release-notes/release-3.0.sgml @@ -2,7 +2,7 @@
Squid 3.0 release notes Squid Developers -$Id: release-3.0.sgml,v 1.10 2003/07/15 20:45:36 wessels Exp $ +$Id: release-3.0.sgml,v 1.11 2003/07/17 22:22:49 wessels Exp $ This document contains the release notes for version 3.0 of Squid. @@ -125,6 +125,8 @@ This fixes two issues:Transparently intercepted requests is no lo external_acl extended with soft timeouts external_acl can optionally return information to be logged in access.log Requests denied due to 'http_reply_access' are now logged with TCP_DENIED_REPLY. + Added counters for HTCP messages sent and received, reported + in 'info' cache manager page. Changes to squid.conf diff --git a/src/htcp.cc b/src/htcp.cc index 089f6955b3..67f22310af 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -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); } diff --git a/src/stat.cc b/src/stat.cc index d1c3a98ccd..12a69619e7 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -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); diff --git a/src/structs.h b/src/structs.h index a5f609a4d5..489933621f 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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;