]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish Peek and Splice
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 13 Aug 2014 11:14:51 +0000 (14:14 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 13 Aug 2014 11:14:51 +0000 (14:14 +0300)
 - Fix debugs ( Remove HERE macro, other minor changes)
 - Formating changes

src/PeerPoolMgr.cc
src/acl/AtBumpStep.cc
src/client_side.cc
src/client_side_request.h
src/tunnel.cc

index 1488bc2a75ce5c239ff9c8a19cef09d55a57ce27..6cb98f334a099bcfc0b92c4a2f75460465264345 100644 (file)
@@ -23,7 +23,7 @@ CBDATA_CLASS_INIT(PeerPoolMgr);
 #if USE_OPENSSL
 /// Gives Ssl::PeerConnector access to Answer in the PeerPoolMgr callback dialer.
 class MyAnswerDialer: public UnaryMemFunT<PeerPoolMgr, Ssl::PeerConnectorAnswer, Ssl::PeerConnectorAnswer&>,
-            public Ssl::PeerConnector::CbDialer
+        public Ssl::PeerConnector::CbDialer
 {
 public:
     MyAnswerDialer(const JobPointer &aJob, Method aMethod):
index b6d3479a39a5302ae91baebd587a65e4859ae564..c231bae49be2ca5c116ac0eadee248ec142d05ac 100644 (file)
@@ -8,7 +8,7 @@
 int
 ACLAtStepStrategy::match (ACLData<Ssl::BumpStep> * &data, ACLFilledChecklist *checklist, ACLFlags &)
 {
-    Ssl::ServerBump *bump;
+    Ssl::ServerBump *bump = NULL;
     if (checklist->conn() != NULL && (bump = checklist->conn()->serverBump()))
         return data->match(bump->step);
     else
index d05627a4003c7ea4070535f1c5aed4e731fd5c39..93427df788d5bef53682df2b7f86d936d05fea8f 100644 (file)
@@ -3611,7 +3611,7 @@ httpsSslBumpAccessCheckDone(allow_t answer, void *data)
     // Require both a match and a positive bump mode to work around exceptional
     // cases where ACL code may return ACCESS_ALLOWED with zero answer.kind.
     if (answer == ACCESS_ALLOWED && (answer.kind != Ssl::bumpNone && answer.kind != Ssl::bumpSplice)) {
-        debugs(33, 2, HERE << "sslBump needed for " << connState->clientConnection << " method " << answer.kind);
+        debugs(33, 2, "sslBump needed for " << connState->clientConnection << " method " << answer.kind);
         connState->sslBumpMode = static_cast<Ssl::BumpMode>(answer.kind);
         httpsEstablish(connState, NULL, (Ssl::BumpMode)answer.kind);
     } else {
@@ -3720,7 +3720,7 @@ ConnStateData::sslCrtdHandleReply(const HelperReply &reply)
                     SSL *ssl = fd_table[clientConnection->fd].ssl;
                     bool ret = Ssl::configureSSLUsingPkeyAndCertFromMemory(ssl, reply_message.getBody().c_str(), *port);
                     if (!ret)
-                        debugs(33, 5, HERE << "Failed to set certificates to ssl object for PeekAndSplice mode");
+                        debugs(33, 5, "Failed to set certificates to ssl object for PeekAndSplice mode");
                 } else {
                     SSL_CTX *ctx = Ssl::generateSslContextUsingPkeyAndCertFromMemory(reply_message.getBody().c_str(), *port);
                     getSslContextDone(ctx, true);
@@ -3833,23 +3833,23 @@ ConnStateData::getSslContextStart()
 
         // Disable caching for bumpPeekAndSplice mode
         if (!(sslServerBump && (sslServerBump->mode == Ssl::bumpPeek || sslServerBump->mode == Ssl::bumpStare))) {
-            debugs(33, 5, HERE << "Finding SSL certificate for " << sslBumpCertKey << " in cache");
+            debugs(33, 5, "Finding SSL certificate for " << sslBumpCertKey << " in cache");
             Ssl::LocalContextStorage * ssl_ctx_cache = Ssl::TheGlobalContextStorage.getLocalStorage(port->s);
             SSL_CTX * dynCtx = NULL;
             Ssl::SSL_CTX_Pointer *cachedCtx = ssl_ctx_cache ? ssl_ctx_cache->get(sslBumpCertKey.termedBuf()) : NULL;
             if (cachedCtx && (dynCtx = cachedCtx->get())) {
-                debugs(33, 5, HERE << "SSL certificate for " << sslBumpCertKey << " have found in cache");
+                debugs(33, 5, "SSL certificate for " << sslBumpCertKey << " found in cache");
                 if (Ssl::verifySslCertificate(dynCtx, certProperties)) {
-                    debugs(33, 5, HERE << "Cached SSL certificate for " << sslBumpCertKey << " is valid");
+                    debugs(33, 5, "Cached SSL certificate for " << sslBumpCertKey << " is valid");
                     getSslContextDone(dynCtx);
                     return;
                 } else {
-                    debugs(33, 5, HERE << "Cached SSL certificate for " << sslBumpCertKey << " is out of date. Delete this certificate from cache");
+                    debugs(33, 5, "Cached SSL certificate for " << sslBumpCertKey << " is out of date. Delete this certificate from cache");
                     if (ssl_ctx_cache)
                         ssl_ctx_cache->del(sslBumpCertKey.termedBuf());
                 }
             } else {
-                debugs(33, 5, HERE << "SSL certificate for " << sslBumpCertKey << " haven't found in cache");
+                debugs(33, 5, "SSL certificate for " << sslBumpCertKey << " haven't found in cache");
             }
         }
 
@@ -3876,7 +3876,7 @@ ConnStateData::getSslContextStart()
             doPeekAndSpliceStep();
             SSL *ssl = fd_table[clientConnection->fd].ssl;
             if (!Ssl::configureSSL(ssl, certProperties, *port))
-                debugs(33, 5, HERE << "Failed to set certificates to ssl object for PeekAndSplice mode");
+                debugs(33, 5, "Failed to set certificates to ssl object for PeekAndSplice mode");
         } else {
             SSL_CTX *dynCtx = Ssl::generateSslContext(certProperties, *port);
             getSslContextDone(dynCtx, true);
@@ -3987,7 +3987,7 @@ clientPeekAndSpliceSSL(int fd, void *data)
     ConnStateData *conn = (ConnStateData *)data;
     SSL *ssl = fd_table[fd].ssl;
 
-    debugs(83, 2, "Start peek and splice on " << fd);
+    debugs(83, 5, "Start peek and splice on " << fd);
 
     if (!Squid_SSL_accept(conn, clientPeekAndSpliceSSL))
         debugs(83, 2, "SSL_accept failed.");
@@ -4002,7 +4002,7 @@ clientPeekAndSpliceSSL(int fd, void *data)
                 conn->serverBump()->clientSni = features.serverName.c_str();
         }
 
-        debugs(83, 2, "I got hello. Start forwarding the request!!! ");
+        debugs(83, 5, "I got hello. Start forwarding the request!!! ");
         Comm::SetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
         Comm::SetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
         conn->startPeekAndSpliceDone();
@@ -4042,7 +4042,7 @@ void httpsSslBumpStep2AccessCheckDone(allow_t answer, void *data)
     if (!connState->isOpen())
         return;
 
-    debugs(33, 5, HERE << "Answer: " << answer << " kind:" << answer.kind);
+    debugs(33, 5, "Answer: " << answer << " kind:" << answer.kind);
     if (answer == ACCESS_ALLOWED && answer.kind != Ssl::bumpNone && answer.kind != Ssl::bumpSplice) {
         if (answer.kind == Ssl::bumpTerminate)
             comm_close(connState->clientConnection->fd);
@@ -4076,7 +4076,7 @@ void httpsSslBumpStep2AccessCheckDone(allow_t answer, void *data)
                 ret = connState->clientParseRequests();
 
             if (!ret) {
-                debugs(33, 2, HERE << "Failed to start fake CONNECT request for ssl spliced connection: " << connState->clientConnection);
+                debugs(33, 2, "Failed to start fake CONNECT request for ssl spliced connection: " << connState->clientConnection);
                 connState->clientConnection->close();
             }
         } else {
@@ -4116,7 +4116,7 @@ ConnStateData::doPeekAndSpliceStep()
     assert(b);
     Ssl::ClientBio *bio = static_cast<Ssl::ClientBio *>(b->ptr);
 
-    debugs(33, 5, HERE << "PeekAndSplice mode, proceed with client negotiation. Currrent state:" << SSL_state_string_long(ssl));
+    debugs(33, 5, "PeekAndSplice mode, proceed with client negotiation. Currrent state:" << SSL_state_string_long(ssl));
     bio->hold(false);
 
     Comm::SetSelect(clientConnection->fd, COMM_SELECT_WRITE, clientNegotiateSSL, this, 0);
index 3b12ed8e80073ab3d8aa9332cbb20a7db8b94725..49e9fe04f3d2c48eb57bb53089e047e5e4d598dd 100644 (file)
@@ -52,8 +52,8 @@ int clientBeginRequest(const HttpRequestMethod&, char const *, CSCB *, CSD *, Cl
 
 class ClientHttpRequest
 #if USE_ADAPTATION
-            : public Adaptation::Initiator, // to start adaptation transactions
-            public BodyConsumer     // to receive reply bodies in request satisf. mode
+        : public Adaptation::Initiator, // to start adaptation transactions
+        public BodyConsumer     // to receive reply bodies in request satisf. mode
 #endif
 {
 
index e05d2e44ca1c7de75e1423fa788ba07cea86b935..b725f44fef9180c6b3e1fc6a7f993b23cf0fb3d3 100644 (file)
@@ -1116,7 +1116,7 @@ switchToTunnel(HttpRequest *request, int *status_ptr, Comm::ConnectionPointer &c
     TunnelStateData *tunnelState = NULL;
     const char *url = urlCanonical(request);
 
-    debugs(26, 3, HERE << "'" << request->method << " " << url << " " << request->http_ver << "'");
+    debugs(26, 3, request->method << " " << url << " " << request->http_ver);
     ++statCounter.server.all.requests;
     ++statCounter.server.other.requests;
 
@@ -1158,7 +1158,7 @@ switchToTunnel(HttpRequest *request, int *status_ptr, Comm::ConnectionPointer &c
     tunnelState->request->peer_host = srvConn->getPeer() ? srvConn->getPeer()->host : NULL;
     comm_add_close_handler(srvConn->fd, tunnelServerClosed, tunnelState);
 
-    debugs(26, 4, HERE << "determine post-connect handling pathway.");
+    debugs(26, 4, "determine post-connect handling pathway.");
     if (srvConn->getPeer()) {
         tunnelState->request->peer_login = srvConn->getPeer()->login;
         tunnelState->request->flags.proxying = !(srvConn->getPeer()->options.originserver);