]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SourceFormat Enforcement
authorAutomatic source maintenance <squidadm@squid-cache.org>
Wed, 7 May 2014 14:40:05 +0000 (08:40 -0600)
committerAutomatic source maintenance <squidadm@squid-cache.org>
Wed, 7 May 2014 14:40:05 +0000 (08:40 -0600)
25 files changed:
errors/language.list
helpers/basic_auth/NIS/basic_nis_auth.cc
src/FwdState.cc
src/PeerPoolMgr.cc
src/PeerPoolMgr.h
src/acl/Ip.cc
src/cache_cf.cc
src/cbdata.cc
src/cf_gen.cc
src/errorpage.cc
src/eui/Eui64.cc
src/external_acl.cc
src/format/Format.cc
src/format/Token.cc
src/ftp.cc
src/http/StatusCode.cc
src/main.cc
src/pconn.h
src/ssl/PeerConnector.cc
src/ssl/PeerConnector.h
src/tests/Stub.list
src/tunnel.cc
src/url.cc
tools/squidclient/Transport.h
tools/squidclient/squidclient.cc

index 5bb236b44fb0b888c8f5e542c69ad3250c505265..69d6f2ccc6a821beb6368a34bc2df712a15ba95a 100644 (file)
@@ -20,6 +20,7 @@ TRANSLATE_LANGUAGES= \
     id.lang \
     it.lang \
     ja.lang \
+    ka.lang \
     ko.lang \
     lt.lang \
     lv.lang \
index 11a215636f200bb5501ba91e99df2d88b67516ac..d850467962ebd376ef45f549f2e7013dafaebd69 100644 (file)
@@ -73,7 +73,8 @@ main(int argc, char **argv)
             /* Password incorrect */
             printf("ERR Wrong password\n");
 #else
-        } else {
+        }
+        else {
             /* Password incorrect */
             printf("BH message=\"Missing crypto capability\"\n");
 #endif
index 3b07d463376b5394920068cb7e2c3abf3430307d..1738566448bda8e6edb5cf5ed9ef1532a8c33af0 100644 (file)
@@ -64,8 +64,8 @@
 #include "mgr/Registration.h"
 #include "neighbors.h"
 #include "pconn.h"
-#include "PeerSelectState.h"
 #include "PeerPoolMgr.h"
+#include "PeerSelectState.h"
 #include "SquidConfig.h"
 #include "SquidTime.h"
 #include "Store.h"
@@ -104,13 +104,14 @@ public:
     typedef void (FwdState::*Method)(Ssl::PeerConnectorAnswer &);
 
     FwdStatePeerAnswerDialer(Method method, FwdState *fwd):
-        method_(method), fwd_(fwd), answer_() {}
+            method_(method), fwd_(fwd), answer_() {}
 
     /* CallDialer API */
     virtual bool canDial(AsyncCall &call) { return fwd_.valid(); }
     void dial(AsyncCall &call) { ((&(*fwd_))->*method_)(answer_); }
     virtual void print(std::ostream &os) const {
-        os << '(' << fwd_.get() << ", " << answer_ << ')'; }
+        os << '(' << fwd_.get() << ", " << answer_ << ')';
+    }
 
     /* Ssl::PeerConnector::CbDialer API */
     virtual Ssl::PeerConnectorAnswer &answer() { return answer_; }
@@ -122,7 +123,6 @@ private:
 };
 #endif
 
-
 void
 FwdState::abort(void* d)
 {
@@ -707,8 +707,8 @@ FwdState::connectDone(const Comm::ConnectionPointer &conn, comm_err_t status, in
 
             HttpRequest::Pointer requestPointer = request;
             AsyncCall::Pointer callback = asyncCall(17,4,
-                "FwdState::ConnectedToPeer",
-                FwdStatePeerAnswerDialer(&FwdState::connectedToPeer, this));
+                                                    "FwdState::ConnectedToPeer",
+                                                    FwdStatePeerAnswerDialer(&FwdState::connectedToPeer, this));
             Ssl::PeerConnector *connector =
                 new Ssl::PeerConnector(requestPointer, serverConnection(), callback);
             AsyncJob::Start(connector); // will call our callback
index 27e62d0fc7c0e4c92bcffccae7cb8a6313a64c18..04124000ea3a07b3fc872b7c24e4683001ec8bab 100644 (file)
@@ -26,7 +26,7 @@ class MyAnswerDialer: public UnaryMemFunT<PeerPoolMgr, Ssl::PeerConnectorAnswer,
 {
 public:
     MyAnswerDialer(const JobPointer &aJob, Method aMethod):
-                   UnaryMemFunT<PeerPoolMgr, Ssl::PeerConnectorAnswer, Ssl::PeerConnectorAnswer&>(aJob, aMethod, Ssl::PeerConnectorAnswer()) {}
+            UnaryMemFunT<PeerPoolMgr, Ssl::PeerConnectorAnswer, Ssl::PeerConnectorAnswer&>(aJob, aMethod, Ssl::PeerConnectorAnswer()) {}
 
     /* Ssl::PeerConnector::CbDialer API */
     virtual Ssl::PeerConnectorAnswer &answer() { return arg1; }
@@ -68,7 +68,8 @@ PeerPoolMgr::swanSong()
 }
 
 bool
-PeerPoolMgr::validPeer() const {
+PeerPoolMgr::validPeer() const
+{
     return peer && cbdataReferenceValid(peer) && peer->standby.pool;
 }
 
index e792fb0f1aaffb0a484ea142c36428fcd8ec9751..be0749bebb175fe1da7e8f8776d292a9a46b88cd 100644 (file)
@@ -9,8 +9,9 @@ class CachePeer;
 class CommConnectCbParams;
 
 #if USE_OPENSSL
-namespace Ssl {
-    class PeerConnectorAnswer;
+namespace Ssl
+{
+class PeerConnectorAnswer;
 }
 #endif
 
index e0354b7e75af83b62c69ee054db0a39e48a6324f..a513cd5763dbffa6b0847e37ed521fc529efe9b3 100644 (file)
@@ -111,7 +111,6 @@ acl_ip_data::toSBuf() const
     return SBuf(tmpbuf);
 }
 
-
 /*
  * aclIpAddrNetworkCompare - The guts of the comparison for IP ACLs
  * matching checks.  The first argument (p) is a "host" address,
index c81c387f4e1775e87e33e5b1f56da3fbc3cb707d..95bea4b0ebde68d2fba6806c64afad56f6a882d0 100644 (file)
@@ -4828,7 +4828,7 @@ static void parse_ftp_epsv(acl_access **ftp_epsv)
     bool ftpEpsvIsDeprecatedRule = false;
 
     char *t = ConfigParser::PeekAtToken();
-    if (!t){
+    if (!t) {
         self_destruct();
         return;
     }
@@ -4848,7 +4848,7 @@ static void parse_ftp_epsv(acl_access **ftp_epsv)
     //   2) if this line is "ftp_epsv on|off" and already exist rules of "ftp_epsv allow|deny ..."
     // then abort
     if ((!ftpEpsvIsDeprecatedRule && FtpEspvDeprecated) ||
-        (ftpEpsvIsDeprecatedRule && !FtpEspvDeprecated && *ftp_epsv != NULL)) {
+            (ftpEpsvIsDeprecatedRule && !FtpEspvDeprecated && *ftp_epsv != NULL)) {
         debugs(3, DBG_CRITICAL, "FATAL: do not mix \"ftp_epsv on|off\" cfg lines with \"ftp_epsv allow|deny ...\" cfg lines. Update your ftp_epsv rules.");
         self_destruct();
     }
index ae2827bf1d10c5bee52570c19c3d955d07c47c59..892518c60dd9ed8b81aa3d9980ec5afd75ce91ae 100644 (file)
@@ -48,9 +48,9 @@
 
 #include "squid.h"
 #include "cbdata.h"
+#include "Generic.h"
 #include "mgr/Registration.h"
 #include "Store.h"
-#include "Generic.h"
 
 #include <climits>
 #if USE_CBDATA_DEBUG
index 50a49ba33c0832f68df9ebb1f4550cd7cc58f20b..e8d280177ba3de37a5589eaf2ff22b7ae11d7a4b 100644 (file)
@@ -874,11 +874,11 @@ gen_quote_escape(const std::string &var)
 
     for (int i = 0; i < var.length(); ++i) {
         switch (var[i]) {
-            case '"':
-            case '\\':
-                esc += '\\';
-            default:
-                esc += var[i];
+        case '"':
+        case '\\':
+            esc += '\\';
+        default:
+            esc += var[i];
         }
     }
 
index a8dbf22e2d092efb4367a19b6ff6de60a55a2374..c355e90efb1d0d2a87dc0f987bfe74c4f89726b4 100644 (file)
@@ -573,7 +573,7 @@ ErrorState::NewForwarding(err_type type, HttpRequest *request)
 {
     assert(request);
     const Http::StatusCode status = request->flags.needValidation ?
-        Http::scGatewayTimeout : Http::scServiceUnavailable;
+                                    Http::scGatewayTimeout : Http::scServiceUnavailable;
     return new ErrorState(type, status, request);
 }
 
@@ -950,8 +950,8 @@ ErrorState::Convert(char token, bool building_deny_info_url, bool allowRecursion
 
     case 'M':
         if (request) {
-           const SBuf &m = request->method.image();
-           mb.append(m.rawContent(), m.length());
+            const SBuf &m = request->method.image();
+            mb.append(m.rawContent(), m.length());
         } else if (!building_deny_info_url)
             p = "[unknown method]";
         break;
index 1c98299e37981348fe51bde4bd7e64852128b952..385529d4ce5b210ea03578f665b07c8c30793348 100644 (file)
@@ -19,8 +19,8 @@ bool
 Eui::Eui64::decode(const char *asc)
 {
     if (eui64_aton(asc, (struct eui64 *)eui) != 0) {
-       debugs(28, 4, "id=" << (void*)this << " decode fail on " << asc);
-       return false;
+        debugs(28, 4, "id=" << (void*)this << " decode fail on " << asc);
+        return false;
     }
 
     debugs(28, 4, "id=" << (void*)this << " ATON decoded " << asc);
index 2fa91d2eba047ad9b568aff96175a623c3fbfbf8..fb1462992e618ae2be9c54da53c500f4423c1c64 100644 (file)
@@ -990,13 +990,12 @@ makeExternalAclKey(ACLFilledChecklist * ch, external_acl_data * acl_data)
             str = request->urlpath.termedBuf();
             break;
 
-        case Format::LFT_CLIENT_REQ_METHOD:
-            {
-                const SBuf &s = request->method.image();
-                sb.append(s.rawContent(), s.length());
-            }
-            str = sb.termedBuf();
-            break;
+        case Format::LFT_CLIENT_REQ_METHOD: {
+            const SBuf &s = request->method.image();
+            sb.append(s.rawContent(), s.length());
+        }
+        str = sb.termedBuf();
+        break;
 
         case Format::LFT_ADAPTED_REQUEST_HEADER:
             if (format->header_id == -1)
index 1cc556fe3b980003b233c36a8016933444fd0bee..0a13cef827e8ef642d52b3a99116cbab02cf692c 100644 (file)
@@ -1185,10 +1185,10 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS
             out = "%";
             break;
 
-        // XXX: external_acl_type format tokens which are not output by logformat.
-        // They are listed here because the switch requires
-        // every ByteCode_t to be explicitly enumerated.
-        // But do not output due to lack of access to the values.
+            // XXX: external_acl_type format tokens which are not output by logformat.
+            // They are listed here because the switch requires
+            // every ByteCode_t to be explicitly enumerated.
+            // But do not output due to lack of access to the values.
         case LFT_EXT_ACL_USER_CERT_RAW:
         case LFT_EXT_ACL_USER_CERTCHAIN_RAW:
         case LFT_EXT_ACL_USER_CERT:
index dc70c23d483df8adaa0c473e5013f8449a6968d3..98319852b140aff10cc7ba48518e30bf12cf8604 100644 (file)
@@ -549,24 +549,22 @@ done:
 }
 
 Format::Token::Token() : type(LFT_NONE),
-                         label(NULL),
-                         widthMin(-1),
-                         widthMax(-1),
-                         quote(LOG_QUOTE_NONE),
-                         left(false),
-                         space(false),
-                         zero(false),
-                         divisor(1),
-                         next(NULL)
+        label(NULL),
+        widthMin(-1),
+        widthMax(-1),
+        quote(LOG_QUOTE_NONE),
+        left(false),
+        space(false),
+        zero(false),
+        divisor(1),
+        next(NULL)
 {
     data.string = NULL;
-    data.header.header = NULL; 
+    data.header.header = NULL;
     data.header.element = NULL;
     data.header.separator = ',';
 }
 
-
-
 Format::Token::~Token()
 {
     label = NULL; // drop reference to global static.
index 346021c8b558fb6b0078d52326104d398ef08928..214106437dd23efd4d8054174a6346ad557fd982 100644 (file)
@@ -2590,7 +2590,7 @@ ftpSendPassive(FtpStateData * ftpState)
             }
         }
     }
-        break;
+    break;
     }
 
     ftpState->writeCommand(cbuf);
index 4afbcc7e070a6967b8b8080026fb6a2c160c23ec..854492ba4bed5c8967b7168b39111ad0de0b80e2 100644 (file)
@@ -7,12 +7,12 @@ Http::StatusCodeString(const Http::StatusCode status)
 {
     switch (status) {
 
-    // 000
+        // 000
     case Http::scNone:
         return "Init";         /* we init .status with code 0 */
         break;
 
-    // 100-199
+        // 100-199
     case Http::scContinue:
         return "Continue";
         break;
@@ -25,7 +25,7 @@ Http::StatusCodeString(const Http::StatusCode status)
         return "Processing";
         break;
 
-    // 200-299
+        // 200-299
     case Http::scOkay:
         return "OK";
         break;
@@ -66,7 +66,7 @@ Http::StatusCodeString(const Http::StatusCode status)
         return "IM Used";
         break;
 
-    // 300-399
+        // 300-399
     case Http::scMultipleChoices:
         return "Multiple Choices";
         break;
@@ -99,7 +99,7 @@ Http::StatusCodeString(const Http::StatusCode status)
         return "Permanent Redirect";
         break;
 
-    // 400-499
+        // 400-499
     case Http::scBadRequest:
         return "Bad Request";
         break;
@@ -200,7 +200,7 @@ Http::StatusCodeString(const Http::StatusCode status)
         return "Request Header Fields Too Large";
         break;
 
-    // 500-599
+        // 500-599
     case Http::scInternalServerError:
         return "Internal Server Error";
         break;
@@ -245,7 +245,7 @@ Http::StatusCodeString(const Http::StatusCode status)
         return "Network Authentication Required";
         break;
 
-    // 600+
+        // 600+
     case Http::scInvalidHeader:
     case Http::scHeaderTooLarge:
         // fall through to default.
index 09d0616b6c6c4213ad8edf6bc8d02b850ecb7a5f..479db26ee2718835a21a472551fff722dce01472 100644 (file)
@@ -497,7 +497,7 @@ mainParseOptions(int argc, char *argv[])
                 fatal("Need to add -DMALLOC_DBG when compiling to use -mX option");
 #endif
 
-            } 
+            }
             break;
 
         case 'n':
index 0301862f319cb0c2f96b1f7221ae1719fbdba544..7dbdb4da53fd5547b0f876821af007a64895cb69 100644 (file)
@@ -120,7 +120,7 @@ public:
      * A caller with a non-retriable transaction should set keepOpen to false
      * and call pop() anyway, even though the caller does not want a pconn.
      * This forces us to close an available persistent connection, avoiding
-     * creating a growing number of open connections when many transactions 
+     * creating a growing number of open connections when many transactions
      * create (and push) persistent connections but are not retriable and,
      * hence, do not need to pop a connection.
      */
index 1d68c78dc5f1144582834171c6363545e05874d9..4fa8be988dd145092a8c0de7c856add3bc66c1e1 100644 (file)
@@ -14,6 +14,7 @@
 #include "globals.h"
 #include "HttpRequest.h"
 #include "neighbors.h"
+#include "SquidConfig.h"
 #include "ssl/cert_validate_message.h"
 #include "ssl/Config.h"
 #include "ssl/ErrorDetail.h"
@@ -21,7 +22,6 @@
 #include "ssl/PeerConnector.h"
 #include "ssl/ServerBump.h"
 #include "ssl/support.h"
-#include "SquidConfig.h"
 
 CBDATA_NAMESPACED_CLASS_INIT(Ssl, PeerConnector);
 
@@ -29,10 +29,10 @@ Ssl::PeerConnector::PeerConnector(
     HttpRequestPointer &aRequest,
     const Comm::ConnectionPointer &aServerConn,
     AsyncCall::Pointer &aCallback):
-    AsyncJob("Ssl::PeerConnector"),
-    request(aRequest),
-    serverConn(aServerConn),
-    callback(aCallback)
+        AsyncJob("Ssl::PeerConnector"),
+        request(aRequest),
+        serverConn(aServerConn),
+        callback(aCallback)
 {
     // if this throws, the caller's cb dialer is not our CbDialer
     Must(dynamic_cast<CbDialer*>(callback->getDialer()));
@@ -378,38 +378,38 @@ Ssl::PeerConnector::handleNegotiateError(const int ret)
     int ssl_error = SSL_get_error(ssl, ret);
 
 #ifdef EPROTO
-        int sysErrNo = EPROTO;
+    int sysErrNo = EPROTO;
 #else
-        int sysErrNo = EACCES;
+    int sysErrNo = EACCES;
 #endif
 
-        switch (ssl_error) {
+    switch (ssl_error) {
 
-        case SSL_ERROR_WANT_READ:
-            Comm::SetSelect(fd, COMM_SELECT_READ, &NegotiateSsl, this, 0);
-            return;
+    case SSL_ERROR_WANT_READ:
+        Comm::SetSelect(fd, COMM_SELECT_READ, &NegotiateSsl, this, 0);
+        return;
 
-        case SSL_ERROR_WANT_WRITE:
-            Comm::SetSelect(fd, COMM_SELECT_WRITE, &NegotiateSsl, this, 0);
-            return;
+    case SSL_ERROR_WANT_WRITE:
+        Comm::SetSelect(fd, COMM_SELECT_WRITE, &NegotiateSsl, this, 0);
+        return;
 
-        case SSL_ERROR_SSL:
-        case SSL_ERROR_SYSCALL:
-            ssl_lib_error = ERR_get_error();
+    case SSL_ERROR_SSL:
+    case SSL_ERROR_SYSCALL:
+        ssl_lib_error = ERR_get_error();
 
-            // store/report errno when ssl_error is SSL_ERROR_SYSCALL, ssl_lib_error is 0, and ret is -1
-            if (ssl_error == SSL_ERROR_SYSCALL && ret == -1 && ssl_lib_error == 0)
-                sysErrNo = errno;
+        // store/report errno when ssl_error is SSL_ERROR_SYSCALL, ssl_lib_error is 0, and ret is -1
+        if (ssl_error == SSL_ERROR_SYSCALL && ret == -1 && ssl_lib_error == 0)
+            sysErrNo = errno;
 
-            debugs(83, DBG_IMPORTANT, "Error negotiating SSL on FD " << fd <<
-                   ": " << ERR_error_string(ssl_lib_error, NULL) << " (" <<
-                   ssl_error << "/" << ret << "/" << errno << ")");
+        debugs(83, DBG_IMPORTANT, "Error negotiating SSL on FD " << fd <<
+               ": " << ERR_error_string(ssl_lib_error, NULL) << " (" <<
+               ssl_error << "/" << ret << "/" << errno << ")");
 
-            break; // proceed to the general error handling code
+        break; // proceed to the general error handling code
 
-        default:
-            break; // no special error handling for all other errors
-        }
+    default:
+        break; // no special error handling for all other errors
+    }
 
     ErrorState *const anErr = ErrorState::NewForwarding(ERR_SECURE_CONNECT_FAIL, request.getRaw());
     anErr->xerrno = sysErrNo;
@@ -501,7 +501,6 @@ Ssl::PeerConnector::callBack()
     ScheduleCallHere(cb);
 }
 
-
 void
 Ssl::PeerConnector::swanSong()
 {
index 48f49ffad3081ffe5d5af2901ebab81409c3fd01..44732c47a0a4d1aecd62c7ed9de47611002e3cf2 100644 (file)
 #ifndef SQUID_SSL_PEER_CONNECTOR_H
 #define SQUID_SSL_PEER_CONNECTOR_H
 
-#include "base/AsyncJob.h"
 #include "base/AsyncCbdataCalls.h"
+#include "base/AsyncJob.h"
 #include "ssl/support.h"
 #include <iosfwd>
 
 class HttpRequest;
 class ErrorState;
 
-namespace Ssl {
+namespace Ssl
+{
 
 class ErrorDetail;
 class CertValidationResponse;
 
 /// PeerConnector results (supplied via a callback).
 /// The connection to peer was secured if and only if the error member is nil.
-class PeerConnectorAnswer {
+class PeerConnectorAnswer
+{
 public:
     ~PeerConnectorAnswer(); ///< deletes error if it is still set
     Comm::ConnectionPointer conn; ///< peer connection (secured on success)
@@ -80,12 +82,13 @@ public:
  \par
  * This job never closes the connection, even on errors. If a 3rd-party
  * closes the connection, this job simply quits without informing the caller.
-*/ 
+*/
 class PeerConnector: virtual public AsyncJob
 {
 public:
     /// Callback dialier API to allow PeerConnector to set the answer.
-    class CbDialer {
+    class CbDialer
+    {
     public:
         virtual ~CbDialer() {}
         /// gives PeerConnector access to the in-dialer answer
@@ -137,7 +140,7 @@ private:
     /// mimics FwdState to minimize changes to FwdState::initiate/negotiateSsl
     Comm::ConnectionPointer const &serverConnection() const { return serverConn; }
 
-    void bail(ErrorState *error); ///< Return an error to the PeerConnector caller 
+    void bail(ErrorState *error); ///< Return an error to the PeerConnector caller
 
     /// Callback the caller class, and pass the ready to communicate secure
     /// connection or an error if PeerConnector failed.
index 36f7b1e4937b8cdcb2450a4947cb50708489909e..a72341207eacef5dcd0442afe839f1d26e48e2d4 100644 (file)
@@ -54,6 +54,7 @@ STUB_SOURCE= tests/STUB.h \
        tests/stub_mem.cc \
        tests/stub_mem_node.cc \
        tests/stub_mime.cc \
+       tests/stub_neighbors.cc \
        tests/stub_pconn.cc \
        tests/stub_redirect.cc \
        tests/stub_stat.cc \
index 7e491338b8b9a73fe3d85f4bab32947af20f3f81..0ba51faf74a11891fbf10fa4def6a522729600fa 100644 (file)
@@ -175,13 +175,14 @@ private:
         typedef void (TunnelStateData::*Method)(Ssl::PeerConnectorAnswer &);
 
         MyAnswerDialer(Method method, TunnelStateData *tunnel):
-                       method_(method), tunnel_(tunnel), answer_() {}
+                method_(method), tunnel_(tunnel), answer_() {}
 
         /* CallDialer API */
         virtual bool canDial(AsyncCall &call) { return tunnel_.valid(); }
         void dial(AsyncCall &call) { ((&(*tunnel_))->*method_)(answer_); }
         virtual void print(std::ostream &os) const {
-            os << '(' << tunnel_.get() << ", " << answer_ << ')'; }
+            os << '(' << tunnel_.get() << ", " << answer_ << ')';
+        }
 
         /* Ssl::PeerConnector::CbDialer API */
         virtual Ssl::PeerConnectorAnswer &answer() { return answer_; }
@@ -947,15 +948,16 @@ tunnelStart(ClientHttpRequest * http, int64_t * size_ptr, int *status_ptr, const
 }
 
 void
-TunnelStateData::connectToPeer() {
+TunnelStateData::connectToPeer()
+{
     const Comm::ConnectionPointer &srv = server.conn;
 
 #if USE_OPENSSL
     if (CachePeer *p = srv->getPeer()) {
         if (p->use_ssl) {
             AsyncCall::Pointer callback = asyncCall(5,4,
-                "TunnelStateData::ConnectedToPeer",
-                MyAnswerDialer(&TunnelStateData::connectedToPeer, this));
+                                                    "TunnelStateData::ConnectedToPeer",
+                                                    MyAnswerDialer(&TunnelStateData::connectedToPeer, this));
             Ssl::PeerConnector *connector =
                 new Ssl::PeerConnector(request, srv, callback);
             AsyncJob::Start(connector); // will call our callback
index c7979cd0aaae7c00b6a192c805e583b6bf2f2fb9..0872a32696fabf42be6b18d98094e94f3033739d 100644 (file)
@@ -508,21 +508,20 @@ urlCanonical(HttpRequest * request)
             snprintf(urlbuf, MAX_URL, "%s:%d", request->GetHost(), request->port);
             break;
 
-        default:
-            {
-                portbuf[0] = '\0';
-
-                if (request->port != urlDefaultPort(request->url.getScheme()))
-                    snprintf(portbuf, 32, ":%d", request->port);
-
-                snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s" SQUIDSTRINGPH,
-                         request->url.getScheme().c_str(),
-                         request->login,
-                         *request->login ? "@" : null_string,
-                         request->GetHost(),
-                         portbuf,
-                         SQUIDSTRINGPRINT(request->urlpath));
-            }
+        default: {
+            portbuf[0] = '\0';
+
+            if (request->port != urlDefaultPort(request->url.getScheme()))
+                snprintf(portbuf, 32, ":%d", request->port);
+
+            snprintf(urlbuf, MAX_URL, "%s://%s%s%s%s" SQUIDSTRINGPH,
+                     request->url.getScheme().c_str(),
+                     request->login,
+                     *request->login ? "@" : null_string,
+                     request->GetHost(),
+                     portbuf,
+                     SQUIDSTRINGPRINT(request->urlpath));
+        }
         }
     }
 
@@ -551,36 +550,35 @@ urlCanonicalClean(const HttpRequest * request)
             snprintf(buf, MAX_URL, "%s:%d", request->GetHost(), request->port);
             break;
 
-        default:
-            {
-                portbuf[0] = '\0';
-
-                if (request->port != urlDefaultPort(request->url.getScheme()))
-                    snprintf(portbuf, 32, ":%d", request->port);
+        default: {
+            portbuf[0] = '\0';
 
-                loginbuf[0] = '\0';
+            if (request->port != urlDefaultPort(request->url.getScheme()))
+                snprintf(portbuf, 32, ":%d", request->port);
 
-                if ((int) strlen(request->login) > 0) {
-                    strcpy(loginbuf, request->login);
+            loginbuf[0] = '\0';
 
-                    if ((t = strchr(loginbuf, ':')))
-                        *t = '\0';
+            if ((int) strlen(request->login) > 0) {
+                strcpy(loginbuf, request->login);
 
-                    strcat(loginbuf, "@");
-                }
+                if ((t = strchr(loginbuf, ':')))
+                    *t = '\0';
 
-                snprintf(buf, MAX_URL, "%s://%s%s%s" SQUIDSTRINGPH,
-                         request->url.getScheme().c_str(),
-                         loginbuf,
-                         request->GetHost(),
-                         portbuf,
-                         SQUIDSTRINGPRINT(request->urlpath));
-
-                // strip arguments AFTER a question-mark
-                if (Config.onoff.strip_query_terms)
-                    if ((t = strchr(buf, '?')))
-                        *(++t) = '\0';
+                strcat(loginbuf, "@");
             }
+
+            snprintf(buf, MAX_URL, "%s://%s%s%s" SQUIDSTRINGPH,
+                     request->url.getScheme().c_str(),
+                     loginbuf,
+                     request->GetHost(),
+                     portbuf,
+                     SQUIDSTRINGPRINT(request->urlpath));
+
+            // strip arguments AFTER a question-mark
+            if (Config.onoff.strip_query_terms)
+                if ((t = strchr(buf, '?')))
+                    *(++t) = '\0';
+        }
         }
     }
 
index f6ece63ca37cadb7135154d509c0fd997b1fa2c9..2e9eb649e0be109a3198fc0afec56911b073fbae 100644 (file)
@@ -17,12 +17,11 @@ class TheConfig
 {
 public:
     TheConfig() :
-        ioTimeout(120),
-        localHost(NULL),
-        port(CACHE_HTTP_PORT),
-        tlsEnabled(false),
-        tlsAnonymous(false)
-    {
+            ioTimeout(120),
+            localHost(NULL),
+            port(CACHE_HTTP_PORT),
+            tlsEnabled(false),
+            tlsAnonymous(false) {
         params = "NORMAL";
         hostname = "localhost";
     }
index bed5253ec32d46fe024677b5d80271d9c64d1cd0..23b8c2ab2b02d87558ab9f33e79e8b2bf770f892 100644 (file)
@@ -122,13 +122,13 @@ usage(const char *progname)
               << "Usage: " << progname << " [Basic Options] [HTTP Options]" << std::endl
               << std::endl;
     std::cerr
-              << "    -s | --quiet    Silent.  Do not print response message to stdout." << std::endl
-              << "    -v | --verbose  Verbose debugging. Repeat (-vv) to increase output level." << std::endl
-              << "                    Levels:" << std::endl
-              << "                      1 - Print outgoing request message to stderr." << std::endl
-              << "                      2 - Print action trace to stderr." << std::endl
-              << "    --help          Display this help text." << std::endl
-              << std::endl;
+        << "    -s | --quiet    Silent.  Do not print response message to stdout." << std::endl
+        << "    -v | --verbose  Verbose debugging. Repeat (-vv) to increase output level." << std::endl
+        << "                    Levels:" << std::endl
+        << "                      1 - Print outgoing request message to stderr." << std::endl
+        << "                      2 - Print action trace to stderr." << std::endl
+        << "    --help          Display this help text." << std::endl
+        << std::endl;
     Transport::Config.usage();
     Ping::Config.usage();
     std::cerr