From: Christos Tsantilas Date: Wed, 13 Aug 2014 11:14:51 +0000 (+0300) Subject: Polish Peek and Splice X-Git-Tag: SQUID_3_5_0_1~89^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4f14091854aa70b88f928c6df7e0d3eabe4574b;p=thirdparty%2Fsquid.git Polish Peek and Splice - Fix debugs ( Remove HERE macro, other minor changes) - Formating changes --- diff --git a/src/PeerPoolMgr.cc b/src/PeerPoolMgr.cc index 1488bc2a75..6cb98f334a 100644 --- a/src/PeerPoolMgr.cc +++ b/src/PeerPoolMgr.cc @@ -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, - public Ssl::PeerConnector::CbDialer + public Ssl::PeerConnector::CbDialer { public: MyAnswerDialer(const JobPointer &aJob, Method aMethod): diff --git a/src/acl/AtBumpStep.cc b/src/acl/AtBumpStep.cc index b6d3479a39..c231bae49b 100644 --- a/src/acl/AtBumpStep.cc +++ b/src/acl/AtBumpStep.cc @@ -8,7 +8,7 @@ int ACLAtStepStrategy::match (ACLData * &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 diff --git a/src/client_side.cc b/src/client_side.cc index d05627a400..93427df788 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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(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(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); diff --git a/src/client_side_request.h b/src/client_side_request.h index 3b12ed8e80..49e9fe04f3 100644 --- a/src/client_side_request.h +++ b/src/client_side_request.h @@ -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 { diff --git a/src/tunnel.cc b/src/tunnel.cc index e05d2e44ca..b725f44fef 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -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);