[PATCH] htcp-off.patch

From: Miquel van Smoorenburg <miquels@dont-contact.us>
Date: Mon, 10 Dec 2001 13:39:45 +0100

This patch is part of the patchset I'm using in the Debian squid-2.4.3
package. Though the patches here are against 2.4.3, they should apply
to 2.5 with minor difficulty.

htcp-off.patch Makes it possible to turn htcp off in squid.conf

This patch makes it possible to turn off HTCP at runtime,
by setting "htcp_port 0" in squid.conf

--- squid-2.4.2.orig/src/htcp.c Sun Apr 1 18:52:45 2001
+++ squid-2.4.2/src/htcp.c Mon Oct 1 14:03:25 2001
@@ -843,6 +843,18 @@
 void
 htcpInit(void)
 {
+ if (Config.Port.htcp <= 0) {
+ /*
+ * Need to allocate a bit of memory anyway, otherwise
+ * mem.c::memCheckInit() will bail out.
+ */
+ memDataInit(MEM_HTCP_SPECIFIER, "htcpSpecifier",
+ sizeof(htcpSpecifier), 0);
+ memDataInit(MEM_HTCP_DETAIL, "htcpDetail", sizeof(htcpDetail), 0);
+ htcpInSocket = -1;
+ debug(31, 1) ("HTCP Disabled.\n");
+ return;
+ }
     enter_suid();
     htcpInSocket = comm_open(SOCK_DGRAM,
         0,
@@ -890,6 +902,8 @@
     Packer pa;
     MemBuf mb;
     http_state_flags flags;
+
+ if (htcpInSocket < 0) return;
     memset(&flags, '\0', sizeof(flags));
     snprintf(vbuf, sizeof(vbuf), "%d/%d",
         req->http_ver.major, req->http_ver.minor);
Received on Mon Dec 10 2001 - 19:03:47 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:40 MST