]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix "method bits" interaction bug with 1.1.X versions.
authorwessels <>
Tue, 24 Mar 1998 00:32:41 +0000 (00:32 +0000)
committerwessels <>
Tue, 24 Mar 1998 00:32:41 +0000 (00:32 +0000)
src/icp_v2.cc
src/icp_v3.cc

index 9bb2e35f8958093448e6d3ecc357061690feb473..baa6c46a4eadefcce17bb164ba7e38c193be4dbd 100644 (file)
@@ -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 */
index aec0430eeca9d78e71be54e7595d9e3f29779abb..1e39bc587bcabfcba4a0a88c629abb574891f655 100644 (file)
@@ -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 */