]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Made ConnStateData::switchToHttps() and friends return void
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 1 Dec 2011 20:50:18 +0000 (13:50 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 1 Dec 2011 20:50:18 +0000 (13:50 -0700)
in preparation of making this code path asynchronous.

No runtime changes expected as their return value was not used anyway.

src/client_side.cc
src/client_side.h

index 7e07cdab93fd9e59dd4730bb8d6dd7d679a21f64..61e844ec4324c1438f47ae6ec8fe23a5179348c4 100644 (file)
@@ -3478,7 +3478,7 @@ ConnStateData::sslCrtdHandleReply(const char * reply)
     getSslContextDone(NULL);
 }
 
-bool
+void
 ConnStateData::getSslContextStart()
 {
     char const * host = sslHostName.termedBuf();
@@ -3490,7 +3490,8 @@ ConnStateData::getSslContextStart()
             debugs(33, 5, HERE << "SSL certificate for " << host << " have found in cache");
             if (Ssl::verifySslCertificateDate(dynCtx)) {
                 debugs(33, 5, HERE << "Cached SSL certificate for " << host << " is valid");
-                return getSslContextDone(dynCtx);
+                getSslContextDone(dynCtx);
+                return;
             } else {
                 debugs(33, 5, HERE << "Cached SSL certificate for " << host << " is out of date. Delete this certificate from cache");
                 ssl_ctx_cache.remove(host);
@@ -3509,17 +3510,18 @@ ConnStateData::getSslContextStart()
         Ssl::writeCertAndPrivateKeyToMemory(port->signingCert, port->signPkey, bufferToWrite);
         request_message.composeBody(map, bufferToWrite);
         Ssl::Helper::GetInstance()->sslSubmit(request_message, sslCrtdHandleReplyWrapper, this);
-        return true;
+        return;
 #else
         debugs(33, 5, HERE << "Generating SSL certificate for " << host);
         dynCtx = Ssl::generateSslContext(host, port->signingCert, port->signPkey);
-        return getSslContextDone(dynCtx, true);
+        getSslContextDone(dynCtx, true);
+        return;
 #endif //USE_SSL_CRTD
     }
-    return getSslContextDone(NULL);
+    getSslContextDone(NULL);
 }
 
-bool
+void
 ConnStateData::getSslContextDone(SSL_CTX * sslContext, bool isNew)
 {
     // Try to add generated ssl context to storage.
@@ -3543,7 +3545,7 @@ ConnStateData::getSslContextDone(SSL_CTX * sslContext, bool isNew)
         if (!port->staticSslContext) {
             debugs(83, 1, "Closing SSL " << clientConnection->remote << " as lacking SSL context");
             clientConnection->close();
-            return false;
+            return;
         } else {
             debugs(33, 5, HERE << "Using static ssl context.");
             sslContext = port->staticSslContext.get();
@@ -3552,7 +3554,7 @@ ConnStateData::getSslContextDone(SSL_CTX * sslContext, bool isNew)
 
     SSL *ssl = NULL;
     if (!(ssl = httpsCreate(clientConnection, sslContext)))
-        return false;
+        return;
 
     // commSetConnTimeout() was called for this request before we switched.
 
@@ -3560,10 +3562,9 @@ ConnStateData::getSslContextDone(SSL_CTX * sslContext, bool isNew)
     Comm::SetSelect(clientConnection->fd, COMM_SELECT_READ, NULL, NULL, 0);
     Comm::SetSelect(clientConnection->fd, COMM_SELECT_READ, clientNegotiateSSL, this, 0);
     switchedToHttps_ = true;
-    return true;
 }
 
-bool
+void
 ConnStateData::switchToHttps(const char *host)
 {
     assert(!switchedToHttps_);
@@ -3579,7 +3580,7 @@ ConnStateData::switchToHttps(const char *host)
     flags.readMore = true;
     debugs(33, 5, HERE << "converting " << clientConnection << " to SSL");
 
-    return getSslContextStart();
+    getSslContextStart();
 }
 
 #endif /* USE_SSL */
index e895024f0442ad12f1a61e0e118572d9f02d37a5..f0960f138d866b10f065c56a10eba8b78f954b5b 100644 (file)
@@ -307,19 +307,19 @@ public:
 
 #if USE_SSL
     /// Start to create dynamic SSL_CTX for host or uses static port SSL context.
-    bool getSslContextStart();
+    void getSslContextStart();
     /**
      * Done create dynamic ssl certificate.
      *
      * \param[in] isNew if generated certificate is new, so we need to add this certificate to storage.
      */
-    bool getSslContextDone(SSL_CTX * sslContext, bool isNew = false);
+    void getSslContextDone(SSL_CTX * sslContext, bool isNew = false);
     /// Callback function. It is called when squid receive message from ssl_crtd.
     static void sslCrtdHandleReplyWrapper(void *data, char *reply);
     /// Proccess response from ssl_crtd.
     void sslCrtdHandleReply(const char * reply);
 
-    bool switchToHttps(const char *host);
+    void switchToHttps(const char *host);
     bool switchedToHttps() const { return switchedToHttps_; }
 #else
     bool switchedToHttps() const { return false; }