]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1983: Update the read timeout when reading from an CONNECT tunnel
authorhno <>
Sat, 2 Jun 2007 18:21:57 +0000 (18:21 +0000)
committerhno <>
Sat, 2 Jun 2007 18:21:57 +0000 (18:21 +0000)
Also need to deal with the timeout while sending data to the server,
or the timeout might trigger during a large PUT/POST.

src/tunnel.cc

index 89c5ebb15de03df5e9ae698ddf8c13dcada361df..8d62b69471ef5c29cbc79deef860ed89e9d9bb3d 100644 (file)
@@ -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) {