]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Document new members and classes, and other minor fixes
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 6 Nov 2015 16:37:01 +0000 (18:37 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 6 Nov 2015 16:37:01 +0000 (18:37 +0200)
src/Downloader.cc
src/Downloader.h
src/ssl/PeerConnector.cc
src/ssl/PeerConnector.h

index 8d5312bd1f6604eeaa35ba5a0c55099433c8d8bc..5ab4fe5abf84378a08a8df6296b7880febf6fd1f 100644 (file)
@@ -15,7 +15,6 @@ Downloader::Downloader(SBuf &url, const MasterXaction::Pointer &xact, AsyncCall:
     status(Http::scNone),
     level_(level)
 {
-    maxObjectSize = 512*1024;
 }
 
 Downloader::~Downloader()
@@ -142,8 +141,8 @@ void
 Downloader::handleReply(HttpReply *reply, StoreIOBuffer receivedData)
 {
     bool existingContent = reply ? reply->content_length : 0;
-    bool exceedSize = (getCurrentContext()->startOfOutput() && existingContent > -1 && (size_t)existingContent > maxObjectSize) || 
-        ((object.length() + receivedData.length) > maxObjectSize);
+    bool exceedSize = (getCurrentContext()->startOfOutput() && existingContent > -1 && (size_t)existingContent > MaxObjectSize) || 
+        ((object.length() + receivedData.length) > MaxObjectSize);
 
     if (exceedSize) {
         status = Http::scInternalServerError;
index aad8e174cee31f722698e801e932d1ea36d11f9b..f17580989ede3e2050945569591146c568d50f0a 100644 (file)
@@ -11,6 +11,8 @@ class Downloader: public ConnStateData
     //     is pure virtual. breaks build on clang if override is used
 
 public:
+
+    /// Callback data to use with Downloader callbacks;
     class CbDialer {
     public:
         CbDialer(): status(Http::scNone) {}
@@ -21,6 +23,8 @@ public:
 
     explicit Downloader(SBuf &url, const MasterXaction::Pointer &xact, AsyncCall::Pointer &aCallback, unsigned int level = 0);
     virtual ~Downloader();
+
+    /// Fake call used internally by Downloader.
     void downloadFinished();
 
     /// The nested level of Downloader object (downloads inside downloads)
@@ -49,12 +53,16 @@ protected:
     virtual void start();
 
 private:
+    /// Schedules for execution the "callback" with parameters the status
+    /// and object
     void callBack();
-    SBuf url_;
-    AsyncCall::Pointer callback;
-    Http::StatusCode status;
+
+    static const size_t MaxObjectSize = 1*1024*1024; ///< The maximum allowed object size.
+
+    SBuf url_; ///< The url to download
+    AsyncCall::Pointer callback; ///< callback to call when download finishes
+    Http::StatusCode status; ///< The download status code
     SBuf object; //object data
-    size_t maxObjectSize;
     unsigned int level_; ///< Holds the nested downloads level
 };
 
index 71c5a620a43d89345e9b21593f38baaee5638c3e..880b9f236e45ae0d16513da02448beb2210c3b0e 100644 (file)
@@ -612,6 +612,7 @@ Ssl::PeerConnector::status() const
     return buf.content();
 }
 
+/// CallDialer to allow use Downloader objects within PeerConnector class.
 class PeerConnectorCertDownloaderDialer: public CallDialer, public Downloader::CbDialer
 {
 public:
@@ -628,8 +629,8 @@ public:
         os << '(' << peerConnector_.get() << ", Http Status:" << status << ')';
     }
 
-    Method method_;
-    CbcPointer<Ssl::PeerConnector> peerConnector_;
+    Method method_; ///< The Ssl::PeerConnector method to dial
+    CbcPointer<Ssl::PeerConnector> peerConnector_; ///< The Ssl::PeerConnector object
 };
 
 void
index ba5af4d5a76f73f7f0cabf30f3059c91d7aea526..f00980927adde65dadf1f20391ed03940ff205ca 100644 (file)
@@ -120,10 +120,15 @@ protected:
     /// Squid COMM_SELECT_READ handler.
     void noteWantRead();
 
+    /// Run the certificates list sent by SSL server and see if there are
+    /// missing certificates. For the certificates there is a issuer URL
+    /// add it to the urlsOfMissingCerts list
     bool checkForMissingCertificates();
 
+    /// Start downloading procedure for the given URL
     void startCertDownloading(SBuf &url);
 
+    /// Called by Downloader after a certificate object downloaded
     void certDownloadingDone(SBuf &object, int status);
 
     /// Called when the openSSL SSL_connect function needs to write data to