]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Non https connectiona on SSL-bump enabled port may stuck
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 17 Jun 2014 14:54:53 +0000 (17:54 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Tue, 17 Jun 2014 14:54:53 +0000 (17:54 +0300)
This is can be seen on skype when try to connect to server using an
SSL-bump enabled squid port. Squid try to bump the connection, waiting for ever
the ssl protocol header, and skype client waits for ever  an answer from the
server.

This patch sets the timeout to Config.Timeout.request (request_timeout)

This is a Measurement Factory project

src/client_side.cc

index a9a5428c7ef4b3cfc4d86489d87136afb53e62c6..c5b9428e42cb98973a442992c67cf4f2ac273b40 100644 (file)
@@ -3923,7 +3923,13 @@ ConnStateData::getSslContextDone(SSL_CTX * sslContext, bool isNew)
     if (!httpsCreate(clientConnection, sslContext))
         return;
 
-    // commSetConnTimeout() was called for this request before we switched.
+    // bumped intercepted conns should already have Config.Timeout.request set
+    // but forwarded connections may only have Config.Timeout.lifetime. [Re]set
+    // to make sure the connection does not get stuck on non-SSL clients.
+    typedef CommCbMemFunT<ConnStateData, CommTimeoutCbParams> TimeoutDialer;
+    AsyncCall::Pointer timeoutCall = JobCallback(33, 5, TimeoutDialer,
+                                                 this, ConnStateData::requestTimeout);
+    commSetConnTimeout(clientConnection, Config.Timeout.request, timeoutCall);
 
     // Disable the client read handler until CachePeer selection is complete
     Comm::SetSelect(clientConnection->fd, COMM_SELECT_READ, NULL, NULL, 0);