From: hno <> Date: Sat, 2 Jun 2007 18:21:57 +0000 (+0000) Subject: Bug #1983: Update the read timeout when reading from an CONNECT tunnel X-Git-Tag: SQUID_3_0_PRE7~228 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99c02c101cb0be4cb6db80afe5c4ce893f216324;p=thirdparty%2Fsquid.git Bug #1983: Update the read timeout when reading from an CONNECT tunnel Also need to deal with the timeout while sending data to the server, or the timeout might trigger during a large PUT/POST. --- diff --git a/src/tunnel.cc b/src/tunnel.cc index 89c5ebb15d..8d62b69471 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -1,6 +1,6 @@ /* - * $Id: tunnel.cc,v 1.171 2007/06/02 12:01:34 hno Exp $ + * $Id: tunnel.cc,v 1.172 2007/06/02 12:21:57 hno Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -229,8 +229,6 @@ TunnelStateData::readServer(char *buf, size_t len, comm_err_t errcode, int xerrn debugs(26, 3, "tunnelReadServer: FD " << server.fd() << ", read " << len << " bytes"); - commSetTimeout(server.fd(), Config.Timeout.read, tunnelTimeout, this); - if (len > 0) { server.bytesIn(len); kb_incr(&statCounter.server.all.kbytes_in, len); @@ -296,6 +294,10 @@ TunnelStateData::copy (size_t len, comm_err_t errcode, int xerrno, Connection &f */ cbdataInternalLock(this); /* ??? should be locked by the caller... */ + /* Bump the server connection timeout on any activity */ + if (server.fd() != -1) + commSetTimeout(server.fd(), Config.Timeout.read, tunnelTimeout, this); + if (len < 0 || errcode) from.error (xerrno); else if (len == 0 || to.fd() == -1) {