From: Automatic source maintenance Date: Wed, 7 May 2014 14:40:05 +0000 (-0600) Subject: SourceFormat Enforcement X-Git-Tag: SQUID_3_5_0_1~244 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e2849af80b058108e1c2e247bc2e8f07352d8eb8;p=thirdparty%2Fsquid.git SourceFormat Enforcement --- diff --git a/errors/language.list b/errors/language.list index 5bb236b44f..69d6f2ccc6 100644 --- a/errors/language.list +++ b/errors/language.list @@ -20,6 +20,7 @@ TRANSLATE_LANGUAGES= \ id.lang \ it.lang \ ja.lang \ + ka.lang \ ko.lang \ lt.lang \ lv.lang \ diff --git a/helpers/basic_auth/NIS/basic_nis_auth.cc b/helpers/basic_auth/NIS/basic_nis_auth.cc index 11a215636f..d850467962 100644 --- a/helpers/basic_auth/NIS/basic_nis_auth.cc +++ b/helpers/basic_auth/NIS/basic_nis_auth.cc @@ -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 diff --git a/src/FwdState.cc b/src/FwdState.cc index 3b07d46337..1738566448 100644 --- a/src/FwdState.cc +++ b/src/FwdState.cc @@ -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 diff --git a/src/PeerPoolMgr.cc b/src/PeerPoolMgr.cc index 27e62d0fc7..04124000ea 100644 --- a/src/PeerPoolMgr.cc +++ b/src/PeerPoolMgr.cc @@ -26,7 +26,7 @@ class MyAnswerDialer: public UnaryMemFunT(aJob, aMethod, Ssl::PeerConnectorAnswer()) {} + UnaryMemFunT(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; } diff --git a/src/PeerPoolMgr.h b/src/PeerPoolMgr.h index e792fb0f1a..be0749bebb 100644 --- a/src/PeerPoolMgr.h +++ b/src/PeerPoolMgr.h @@ -9,8 +9,9 @@ class CachePeer; class CommConnectCbParams; #if USE_OPENSSL -namespace Ssl { - class PeerConnectorAnswer; +namespace Ssl +{ +class PeerConnectorAnswer; } #endif diff --git a/src/acl/Ip.cc b/src/acl/Ip.cc index e0354b7e75..a513cd5763 100644 --- a/src/acl/Ip.cc +++ b/src/acl/Ip.cc @@ -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, diff --git a/src/cache_cf.cc b/src/cache_cf.cc index c81c387f4e..95bea4b0eb 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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(); } diff --git a/src/cbdata.cc b/src/cbdata.cc index ae2827bf1d..892518c60d 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -48,9 +48,9 @@ #include "squid.h" #include "cbdata.h" +#include "Generic.h" #include "mgr/Registration.h" #include "Store.h" -#include "Generic.h" #include #if USE_CBDATA_DEBUG diff --git a/src/cf_gen.cc b/src/cf_gen.cc index 50a49ba33c..e8d280177b 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -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]; } } diff --git a/src/errorpage.cc b/src/errorpage.cc index a8dbf22e2d..c355e90efb 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -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; diff --git a/src/eui/Eui64.cc b/src/eui/Eui64.cc index 1c98299e37..385529d4ce 100644 --- a/src/eui/Eui64.cc +++ b/src/eui/Eui64.cc @@ -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); diff --git a/src/external_acl.cc b/src/external_acl.cc index 2fa91d2eba..fb1462992e 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -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) diff --git a/src/format/Format.cc b/src/format/Format.cc index 1cc556fe3b..0a13cef827 100644 --- a/src/format/Format.cc +++ b/src/format/Format.cc @@ -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: diff --git a/src/format/Token.cc b/src/format/Token.cc index dc70c23d48..98319852b1 100644 --- a/src/format/Token.cc +++ b/src/format/Token.cc @@ -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. diff --git a/src/ftp.cc b/src/ftp.cc index 346021c8b5..214106437d 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -2590,7 +2590,7 @@ ftpSendPassive(FtpStateData * ftpState) } } } - break; + break; } ftpState->writeCommand(cbuf); diff --git a/src/http/StatusCode.cc b/src/http/StatusCode.cc index 4afbcc7e07..854492ba4b 100644 --- a/src/http/StatusCode.cc +++ b/src/http/StatusCode.cc @@ -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. diff --git a/src/main.cc b/src/main.cc index 09d0616b6c..479db26ee2 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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': diff --git a/src/pconn.h b/src/pconn.h index 0301862f31..7dbdb4da53 100644 --- a/src/pconn.h +++ b/src/pconn.h @@ -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. */ diff --git a/src/ssl/PeerConnector.cc b/src/ssl/PeerConnector.cc index 1d68c78dc5..4fa8be988d 100644 --- a/src/ssl/PeerConnector.cc +++ b/src/ssl/PeerConnector.cc @@ -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(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() { diff --git a/src/ssl/PeerConnector.h b/src/ssl/PeerConnector.h index 48f49ffad3..44732c47a0 100644 --- a/src/ssl/PeerConnector.h +++ b/src/ssl/PeerConnector.h @@ -29,22 +29,24 @@ #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 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. diff --git a/src/tests/Stub.list b/src/tests/Stub.list index 36f7b1e493..a72341207e 100644 --- a/src/tests/Stub.list +++ b/src/tests/Stub.list @@ -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 \ diff --git a/src/tunnel.cc b/src/tunnel.cc index 7e491338b8..0ba51faf74 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -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 diff --git a/src/url.cc b/src/url.cc index c7979cd0aa..0872a32696 100644 --- a/src/url.cc +++ b/src/url.cc @@ -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'; + } } } diff --git a/tools/squidclient/Transport.h b/tools/squidclient/Transport.h index f6ece63ca3..2e9eb649e0 100644 --- a/tools/squidclient/Transport.h +++ b/tools/squidclient/Transport.h @@ -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"; } diff --git a/tools/squidclient/squidclient.cc b/tools/squidclient/squidclient.cc index bed5253ec3..23b8c2ab2b 100644 --- a/tools/squidclient/squidclient.cc +++ b/tools/squidclient/squidclient.cc @@ -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