]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix assertion comm.cc:759: "Comm::IsConnOpen(conn)" in ConnStateData::getSslContextDone
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 5 Jun 2015 23:41:22 +0000 (16:41 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 5 Jun 2015 23:41:22 +0000 (16:41 -0700)
This is an ssertion inside ConnStateData::getSslContextDone while
setting timeout. The reason is that the ConnStateData::clientConnection
may closed while waiting response from ssl_crtd helper.

This is a Measurement Factory project

src/client_side.cc
src/ssl/support.cc

index c06e085934e2dafc9447066c632d1e927f49473e..27a3f0d82d8ee3f2113398df4871faa99eb65581 100644 (file)
@@ -3947,6 +3947,11 @@ ConnStateData::sslCrtdHandleReplyWrapper(void *data, const Helper::Reply &reply)
 void
 ConnStateData::sslCrtdHandleReply(const Helper::Reply &reply)
 {
+    if (!isOpen()) {
+        debugs(33, 3, "Connection gone while waiting for ssl_crtd helper reply; helper reply:" << reply);
+        return;
+    }
+
     if (reply.result == Helper::BrokenHelper) {
         debugs(33, 5, HERE << "Certificate for " << sslConnectHostOrIp << " cannot be generated. ssl_crtd response: " << reply);
     } else if (!reply.other().hasContent()) {
index 5e857c5c9f729d9c66c11dfecea4251d9ff28ca3..0de6ce1c8d2659b0b940765de4d9662cb2622619 100644 (file)
@@ -1804,6 +1804,11 @@ bool Ssl::generateUntrustedCert(X509_Pointer &untrustedCert, EVP_PKEY_Pointer &u
 SSL *
 SslCreate(SSL_CTX *sslContext, const int fd, Ssl::Bio::Type type, const char *squidCtx)
 {
+    if (fd < 0) {
+        debugs(83, DBG_IMPORTANT, "Gone connection");
+        return NULL;
+    }
+
     const char *errAction = NULL;
     int errCode = 0;
     if (SSL *ssl = SSL_new(sslContext)) {