------------------------------------------------------------ revno: 13962 revision-id: squid3@treenet.co.nz-20151218124401-2ov1v9a13jtwmscs parent: squid3@treenet.co.nz-20151218111153-5swog1ie5ql16tox author: Christos Tsantilas committer: Amos Jeffries branch nick: 3.5 timestamp: Sat 2015-12-19 01:44:01 +1300 message: Fix connection retry and fallback after failed server TLS connections FwdState should retry connect to the next ip after a Ssl::PeerConnector failure When the Ssl::PeerConnector fails to establish an SSL connection FwdState does not retry to connect to the next destination server ip address, but instead returns an error. This is a Measurement Factory project ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20151218124401-2ov1v9a13jtwmscs # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: c2b17f3dd5d75c204f794e7a641e16e423f26f92 # timestamp: 2015-12-18 12:58:02 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20151218111153-\ # 5swog1ie5ql16tox # # Begin patch === modified file 'src/FwdState.cc' --- src/FwdState.cc 2015-11-14 23:42:41 +0000 +++ src/FwdState.cc 2015-12-18 12:44:01 +0000 @@ -672,15 +672,10 @@ } serverConn = conn; - flags.connected_okay = true; - debugs(17, 3, HERE << serverConnection() << ": '" << entry->url() << "'" ); comm_add_close_handler(serverConnection()->fd, fwdServerClosedWrapper, this); - if (serverConnection()->getPeer()) - peerConnectSucceded(serverConnection()->getPeer()); - #if USE_OPENSSL if (!request->flags.pinned) { const CachePeer *p = serverConnection()->getPeer(); @@ -719,10 +714,16 @@ if (ErrorState *error = answer.error.get()) { fail(error); answer.error.clear(); // preserve error for errorSendComplete() - self = NULL; + if (CachePeer *p = serverConnection()->getPeer()) + peerConnectFailed(p); + retryOrBail(); return; } + if (serverConnection()->getPeer()) + peerConnectSucceded(serverConnection()->getPeer()); + + flags.connected_okay = true; dispatch(); } #endif