]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Fabian Hugelshofer <fh@open.ch>
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 25 Jan 2011 08:55:40 +0000 (21:55 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 25 Jan 2011 08:55:40 +0000 (21:55 +1300)
Allow persistent connections for Mozilla/3.0 User-Agents

This fixes NTLM and Negotiate authentication for these agents.

History:

In 1998 a hack was added to HttpMsg::persistent() that disables
persistent connections for HTTP/1.0 User-Agents starting with
"Mozilla/3." and "Netscape/3.".

According to the thread on squid-dev
(http://www.eu.squid-cache.org/mail-archive/squid-dev/199805/0087.html),
this was necessary to make some versions of Netscape browsers work that
had a broken implementation of persistent connections. It was said that
"NS 3.01 is ok. NS 3.02 is bad. NS 3.04 is good." Netscape 4 was ok, too.

src/HttpMsg.cc

index c2ed19009b0e6e39450d9d745965530f1ec2d7e5..276ca59acffb66b9067c253ece0483a0276c459d 100644 (file)
@@ -326,21 +326,6 @@ HttpMsg::persistent() const
          */
         return !httpHeaderHasConnDir(&header, "close");
     } else {
-        /*
-         * Persistent connections in Netscape 3.x are allegedly broken,
-         * return false if it is a browser connection.  If there is a
-         * VIA header, then we assume this is NOT a browser connection.
-         */
-        const char *agent = header.getStr(HDR_USER_AGENT);
-
-        if (agent && !header.has(HDR_VIA)) {
-            if (!strncasecmp(agent, "Mozilla/3.", 10))
-                return 0;
-
-            if (!strncasecmp(agent, "Netscape/3.", 11))
-                return 0;
-        }
-
         /* for old versions of HTTP: persistent if has "keep-alive" */
         return httpHeaderHasConnDir(&header, "keep-alive");
     }