From: Source Maintenance Date: Mon, 1 Aug 2016 12:12:15 +0000 (+0000) Subject: SourceFormat Enforcement X-Git-Tag: SQUID_4_0_13~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3945c91db370b64af5fb02cd784bf78f9a59b382;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/src/Downloader.cc b/src/Downloader.cc index 7a05a5970a..94d90f9ca2 100644 --- a/src/Downloader.cc +++ b/src/Downloader.cc @@ -8,8 +8,8 @@ #include "squid.h" #include "client_side.h" -#include "client_side_request.h" #include "client_side_reply.h" +#include "client_side_request.h" #include "ClientRequestContext.h" #include "Downloader.h" #include "http/one/RequestParser.h" @@ -85,7 +85,7 @@ downloaderRecipient(clientStreamNode * node, ClientHttpRequest * http, HttpReply * rep, StoreIOBuffer receivedData) { debugs(33, 6, MYNAME); - /* Test preconditions */ + /* Test preconditions */ assert(node); /* TODO: handle this rather than asserting @@ -112,7 +112,7 @@ downloaderDetach(clientStreamNode * node, ClientHttpRequest * http) /// Initializes and starts the HTTP GET request to the remote server bool Downloader::buildRequest() -{ +{ const HttpRequestMethod method = Http::METHOD_GET; char *uri = xstrdup(url_.c_str()); @@ -211,7 +211,7 @@ Downloader::handleReply(clientStreamNode * node, ClientHttpRequest *http, HttpRe tempBuffer.length = HTTP_REQBUF_SZ; clientStreamRead(node, http, tempBuffer); } - break; + break; case STREAM_COMPLETE: debugs(33, 3, "Object data transfer successfully complete"); callBack(Http::scOkay); @@ -233,8 +233,8 @@ void Downloader::downloadFinished() { debugs(33, 7, this); - // We cannot delay http destruction until refcounting deletes - // DownloaderContext. The http object destruction will cause + // We cannot delay http destruction until refcounting deletes + // DownloaderContext. The http object destruction will cause // clientStream cleanup and will release the refcount to context_ // object hold by clientStream structures. context_->finished(); @@ -247,20 +247,20 @@ Downloader::downloadFinished() void Downloader::callBack(Http::StatusCode const statusCode) { - CbDialer *dialer = dynamic_cast(callback_->getDialer()); - Must(dialer); - dialer->status = statusCode; - if (statusCode == Http::scOkay) - dialer->object = object_; - ScheduleCallHere(callback_); - callback_ = nullptr; - - // Calling deleteThis method here to finish Downloader - // may result to squid crash. - // This method called by handleReply method which maybe called - // by ClientHttpRequest::doCallouts. The doCallouts after this object - // deleted, may operate on non valid objects. - // Schedule an async call here just to force squid to delete this object. - CallJobHere(33, 7, CbcPointer(this), Downloader, downloadFinished); + CbDialer *dialer = dynamic_cast(callback_->getDialer()); + Must(dialer); + dialer->status = statusCode; + if (statusCode == Http::scOkay) + dialer->object = object_; + ScheduleCallHere(callback_); + callback_ = nullptr; + + // Calling deleteThis method here to finish Downloader + // may result to squid crash. + // This method called by handleReply method which maybe called + // by ClientHttpRequest::doCallouts. The doCallouts after this object + // deleted, may operate on non valid objects. + // Schedule an async call here just to force squid to delete this object. + CallJobHere(33, 7, CbcPointer(this), Downloader, downloadFinished); } diff --git a/src/Downloader.h b/src/Downloader.h index d15ec32081..7c681ed3cb 100644 --- a/src/Downloader.h +++ b/src/Downloader.h @@ -53,7 +53,7 @@ public: /// The nested level of Downloader object (downloads inside downloads). unsigned int nestedLevel() const {return level_;} - + void handleReply(clientStreamNode *, ClientHttpRequest *, HttpReply *, StoreIOBuffer); protected: @@ -80,3 +80,4 @@ private: }; #endif + diff --git a/src/security/PeerConnector.cc b/src/security/PeerConnector.cc index 720ffa7f03..5d3022636d 100644 --- a/src/security/PeerConnector.cc +++ b/src/security/PeerConnector.cc @@ -562,8 +562,8 @@ void Security::PeerConnector::startCertDownloading(SBuf &url) { AsyncCall::Pointer certCallback = asyncCall(81, 4, - "Security::PeerConnector::certDownloadingDone", - PeerConnectorCertDownloaderDialer(&Security::PeerConnector::certDownloadingDone, this)); + "Security::PeerConnector::certDownloadingDone", + PeerConnectorCertDownloaderDialer(&Security::PeerConnector::certDownloadingDone, this)); const Downloader *csd = dynamic_cast(request->downloader.valid()); Downloader *dl = new Downloader(url, certCallback, csd ? csd->nestedLevel() + 1 : 1); @@ -642,3 +642,4 @@ Security::PeerConnector::checkForMissingCertificates() return false; } #endif //USE_OPENSSL + diff --git a/src/security/PeerConnector.h b/src/security/PeerConnector.h index fad47517cd..2480ddf343 100644 --- a/src/security/PeerConnector.h +++ b/src/security/PeerConnector.h @@ -128,7 +128,7 @@ protected: #if USE_OPENSSL /// Run the certificates list sent by the SSL server and check if there - /// are missing certificates. Adds to the urlOfMissingCerts list the + /// are missing certificates. Adds to the urlOfMissingCerts list the /// URLS of missing certificates if this information provided by the /// issued certificates with Authority Info Access extension. bool checkForMissingCertificates(); diff --git a/src/ssl/bio.cc b/src/ssl/bio.cc index c048d07f54..aad2558488 100644 --- a/src/ssl/bio.cc +++ b/src/ssl/bio.cc @@ -277,9 +277,9 @@ Ssl::ServerBio::readAndParse(char *buf, const int size, BIO *table) } if (holdRead_) { - debugs(83, 7, "Hold flag is set, retry latter. (Hold " << size << "bytes)"); - BIO_set_retry_read(table); - return -1; + debugs(83, 7, "Hold flag is set, retry latter. (Hold " << size << "bytes)"); + BIO_set_retry_read(table); + return -1; } return giveBuffered(buf, size); diff --git a/src/ssl/support.cc b/src/ssl/support.cc index d788b72886..3ba143a72d 100644 --- a/src/ssl/support.cc +++ b/src/ssl/support.cc @@ -1182,7 +1182,7 @@ Ssl::uriOfIssuerIfMissing(X509 *cert, Security::CertList const &serverCertificat if (!findCertIssuer(serverCertificates, cert)) { //if issuer is missing if (!findCertIssuerFast(SquidUntrustedCerts, cert)) { - // and issuer not found in local untrusted certificates database + // and issuer not found in local untrusted certificates database if (const char *issuerUri = hasAuthorityInfoAccessCaIssuers(cert)) { // There is a URI where we can download a certificate. return issuerUri;