--------------------- PatchSet 3544 Date: 2002/01/06 11:55:28 Author: serassio Branch: nt-2_3 Tag: (none) Log: Back ported htcp-off patch from HEAD Members: src/htcp.c:1.1.1.2.4.1.2.4->1.1.1.2.4.1.2.5 Index: squid/src/htcp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/htcp.c,v retrieving revision 1.1.1.2.4.1.2.4 retrieving revision 1.1.1.2.4.1.2.5 diff -u -r1.1.1.2.4.1.2.4 -r1.1.1.2.4.1.2.5 --- squid/src/htcp.c 1 Sep 2001 15:08:11 -0000 1.1.1.2.4.1.2.4 +++ squid/src/htcp.c 6 Jan 2002 11:55:28 -0000 1.1.1.2.4.1.2.5 @@ -1,6 +1,6 @@ /* - * $Id: htcp.c,v 1.1.1.2.4.1.2.4 2001/09/01 15:08:11 serassio Exp $ + * $Id: htcp.c,v 1.1.1.2.4.1.2.5 2002/01/06 11:55:28 serassio Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -839,6 +839,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, SQUID_IPPROTO_UDP, @@ -886,6 +898,10 @@ Packer pa; MemBuf mb; http_state_flags flags; + + if (htcpInSocket < 0) + return; + memset(&flags, '\0', sizeof(flags)); snprintf(vbuf, sizeof(vbuf), "%3.1f", req->http_ver); stuff.op = HTCP_TST;