From: Christos Tsantilas Date: Thu, 9 Apr 2015 07:08:47 +0000 (+0300) Subject: Fix HttpStateData::readReply to retry read from server in the case of EINPROGRESS... X-Git-Tag: merge-candidate-3-v1~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da958e50da47960be475a8ee3c1f3818f248b31a;p=thirdparty%2Fsquid.git Fix HttpStateData::readReply to retry read from server in the case of EINPROGRESS, EAGAIN or similar errors This bug mostly affects SSL bumped connections. The HttpStateData::readReply will not retry read from server in the case of an EINPROGRESS or similar comm errors and the connection will hang, until the timeout handler called. The Comm::ReadNow method calls ignoreErrno function to test if the comm error should be ignored and in this case return Comm::INPROGRESS value. In this case we need to set flags.do_next_read to true to force HttpStateData::maybeReadVirginBody() method retry read. This is a Measurement Factory project --- diff --git a/src/http.cc b/src/http.cc index 5c3abc9a97..790b8bd09f 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1192,6 +1192,7 @@ HttpStateData::readReply(const CommIoCbParams &io) case Comm::INPROGRESS: if (inBuf.isEmpty()) debugs(33, 2, io.conn << ": no data to process, " << xstrerr(rd.xerrno)); + flags.do_next_read = true; maybeReadVirginBody(); return; @@ -1234,16 +1235,11 @@ HttpStateData::readReply(const CommIoCbParams &io) // case Comm::COMM_ERROR: default: // no other flags should ever occur debugs(11, 2, io.conn << ": read failure: " << xstrerr(rd.xerrno)); - - if (ignoreErrno(rd.xerrno)) { - flags.do_next_read = true; - } else { - ErrorState *err = new ErrorState(ERR_READ_ERROR, Http::scBadGateway, fwd->request); - err->xerrno = rd.xerrno; - fwd->fail(err); - flags.do_next_read = false; - io.conn->close(); - } + ErrorState *err = new ErrorState(ERR_READ_ERROR, Http::scBadGateway, fwd->request); + err->xerrno = rd.xerrno; + fwd->fail(err); + flags.do_next_read = false; + io.conn->close(); return; }