]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4206: Regression in expect:100-continue
authorMike Mitchell <mike.mitchell@sas.com>
Mon, 16 Mar 2015 09:52:13 +0000 (02:52 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 16 Mar 2015 09:52:13 +0000 (02:52 -0700)
src/client_side.cc

index 613678f339e12a2fc05989217329215ff29732a5..90f451b2933fd0dc00ec903256a71f5847a6929b 100644 (file)
@@ -235,7 +235,8 @@ ConnStateData::readSomeData()
 
     debugs(33, 4, HERE << clientConnection << ": reading request...");
 
-    if (!in.maybeMakeSpaceAvailable())
+    // we can only read if there is more than 1 byte of space free
+    if (Config.maxRequestBufferSize - in.buf.length() < 2)
         return;
 
     typedef CommCbMemFunT<ConnStateData, CommIoCbParams> Dialer;
@@ -3123,6 +3124,7 @@ ConnStateData::clientReadRequest(const CommIoCbParams &io)
      * Plus, it breaks our lame *HalfClosed() detection
      */
 
+    in.maybeMakeSpaceAvailable();
     CommIoCbParams rd(this); // will be expanded with ReadNow results
     rd.conn = io.conn;
     switch (Comm::ReadNow(rd, in.buf)) {
@@ -3438,9 +3440,6 @@ ConnStateData::start()
     BodyProducer::start();
     HttpControlMsgSink::start();
 
-    // ensure a buffer is present for this connection
-    in.maybeMakeSpaceAvailable();
-
     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)