From: wessels <> Date: Tue, 24 Mar 1998 00:32:41 +0000 (+0000) Subject: Fix "method bits" interaction bug with 1.1.X versions. X-Git-Tag: SQUID_3_0_PRE1~3768 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db1046b1cc985325bad996ce9c85c46f91b30b67;p=thirdparty%2Fsquid.git Fix "method bits" interaction bug with 1.1.X versions. --- diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 9bb2e35f89..baa6c46a4e 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -157,12 +157,9 @@ icpHandleIcpV2(int fd, struct sockaddr_in from, char *buf, int len) header.pad = ntohl(header.pad); method = header.reqnum >> 24; - /* check if method is valid */ - if (method >= METHOD_ENUM_END) { - debug(12, 0) ("icpHandleIcpV2: UNKNOWN METHOD: %d from %s\n", - method, inet_ntoa(from.sin_addr)); - return; - } + /* Squid-1.1 doesn't use the "method bits" for METHOD_GET */ + if (METHOD_NONE == method || METHOD_ENUM_END <= method) + method = METHOD_GET; switch (header.opcode) { case ICP_QUERY: /* We have a valid packet */ diff --git a/src/icp_v3.cc b/src/icp_v3.cc index aec0430eec..1e39bc587b 100644 --- a/src/icp_v3.cc +++ b/src/icp_v3.cc @@ -23,6 +23,9 @@ icpHandleIcpV3(int fd, struct sockaddr_in from, char *buf, int len) header.pad = ntohl(header.pad); method = header.reqnum >> 24; + /* Squid-1.1 doesn't use the "method bits" for METHOD_GET */ + if (METHOD_NONE == method || METHOD_ENUM_END <= method) + method = METHOD_GET; switch (header.opcode) { case ICP_QUERY: /* We have a valid packet */