]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Various audit updates
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 25 Jul 2014 05:53:32 +0000 (22:53 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 25 Jul 2014 05:53:32 +0000 (22:53 -0700)
src/client_side.cc
src/client_side.h

index 3c171e7e86e1f61b53f0f34cbbc3d8cca54f249c..ba587b692ab53826fdc401b2675c7ac524ecdea5 100644 (file)
@@ -2949,7 +2949,7 @@ static const SBuf Proxy20magic("\x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A
  * Version 1 and 2 header currently supported.
  */
 bool
-ConnStateData::findProxyProtocolMagic()
+ConnStateData::parseProxyProtocolHeader()
 {
     // http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt
 
@@ -2967,6 +2967,9 @@ ConnStateData::findProxyProtocolMagic()
         return proxyProtocolError("PROXY protocol error: invalid header");
     }
 
+    // TODO: detect short non-magic prefixes earlier to avoid
+    // waiting for more data which may never come
+
     // not enough bytes to parse yet.
     return false;
 }
@@ -3168,7 +3171,7 @@ ConnStateData::clientParseRequests()
         PROF_start(parseHttpRequest);
 
         // try to parse the PROXY protocol header magic bytes
-        if (needProxyProtocolHeader_ && !findProxyProtocolMagic())
+        if (needProxyProtocolHeader_ && !parseProxyProtocolHeader())
             break;
 
         HttpParserInit(&parser_, in.buf.c_str(), in.buf.length());
@@ -3522,7 +3525,6 @@ ConnStateData::ConnStateData(const MasterXaction::Pointer &xact) :
     log_addr = xact->tcpClient->remote;
     log_addr.applyMask(Config.Addrs.client_netmask);
 
-    // XXX: should do this in start(), but SSL/TLS operations begin before start() is called
     if (port->disable_pmtu_discovery != DISABLE_PMTU_OFF &&
             (transparent() || port->disable_pmtu_discovery == DISABLE_PMTU_ALWAYS)) {
 #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
index 6d34e453703121870505246a85b27be9adaa59f0..93106129240bcbb40f5e2cb44e6236e1d9c75fc2 100644 (file)
@@ -402,7 +402,7 @@ private:
 
     /* PROXY protocol functionality */
     bool proxyProtocolValidateClient();
-    bool findProxyProtocolMagic();
+    bool parseProxyProtocolHeader();
     bool parseProxy10();
     bool parseProxy20();
     bool proxyProtocolError(const char *reason = NULL);