From: Mike Mitchell Date: Mon, 16 Mar 2015 09:52:13 +0000 (-0700) Subject: Bug 4206: Regression in expect:100-continue X-Git-Tag: merge-candidate-3-v1~213 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d1376d7;p=thirdparty%2Fsquid.git Bug 4206: Regression in expect:100-continue --- diff --git a/src/client_side.cc b/src/client_side.cc index 613678f339..90f451b293 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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 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)