From 4d1376d77a25953ffcce4af22919191db0be4c6d Mon Sep 17 00:00:00 2001 From: Mike Mitchell Date: Mon, 16 Mar 2015 02:52:13 -0700 Subject: [PATCH] Bug 4206: Regression in expect:100-continue --- src/client_side.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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) -- 2.47.2