From db1046b1cc985325bad996ce9c85c46f91b30b67 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Tue, 24 Mar 1998 00:32:41 +0000 Subject: [PATCH] Fix "method bits" interaction bug with 1.1.X versions. --- src/icp_v2.cc | 9 +++------ src/icp_v3.cc | 3 +++ 2 files changed, 6 insertions(+), 6 deletions(-) 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 */ -- 2.47.3