From: Amos Jeffries Date: Tue, 24 May 2011 10:44:39 +0000 (+1200) Subject: Audit review changes X-Git-Tag: take08~55^2~124^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e83cc7854687d12069cac6974f9db1838be130ef;p=thirdparty%2Fsquid.git Audit review changes --- diff --git a/src/Server.cc b/src/Server.cc index 754fc44957..4b282e36e9 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -410,7 +410,7 @@ ServerStateData::sendMoreRequestBody() assert(requestBodySource != NULL); assert(!requestSender); - const Comm::ConnectionPointer conn = dataDescriptor(); + const Comm::ConnectionPointer conn = dataConnection(); if (!Comm::IsConnOpen(conn)) { debugs(9,3, HERE << "cannot send request body to closing " << conn); diff --git a/src/Server.h b/src/Server.h index 4032ac1568..ce8483b765 100644 --- a/src/Server.h +++ b/src/Server.h @@ -68,7 +68,7 @@ public: virtual ~ServerStateData(); /// \return primary or "request data connection" - virtual const Comm::ConnectionPointer & dataDescriptor() const = 0; + virtual const Comm::ConnectionPointer & dataConnection() const = 0; // BodyConsumer: consume request body or adapted response body. // The implementation just calls the corresponding HTTP or ICAP handle*() diff --git a/src/acl/Asn.cc b/src/acl/Asn.cc index 83fe1b858c..05c5640a97 100644 --- a/src/acl/Asn.cc +++ b/src/acl/Asn.cc @@ -250,8 +250,7 @@ asnCacheStart(int as) if ((e = storeGetPublic(asres, METHOD_GET)) == NULL) { e = storeCreateEntry(asres, asres, request_flags(), METHOD_GET); asState->sc = storeClientListAdd(e, asState); - Comm::ConnectionPointer nul; - FwdState::fwdStart(nul, e, asState->request); + FwdState::fwdStart(Comm::ConnectionPointer(), e, asState->request); } else { e->lock(); diff --git a/src/comm/Connection.h b/src/comm/Connection.h index 712d691db9..7bf2dcf49f 100644 --- a/src/comm/Connection.h +++ b/src/comm/Connection.h @@ -78,10 +78,9 @@ namespace Comm { * object for state data. But a semantic equivalent for FD with easily * accessible cached properties not requiring repeated complex lookups. * - * While the properties may be changed, this is for teh purpose of creating - * potential connection descriptors which may be opened. Properties should - * be considered read-only outside of the Comm layer code once the connection - * is open. + * Connection properties may be changed until tehe connection is opened. + * Properties should be considered read-only outside of the Comm layer + * code once the connection is open. * * These objects must not be passed around directly, * but a Comm::ConnectionPointer must be passed instead. @@ -89,7 +88,6 @@ namespace Comm { class Connection : public RefCountable { public: - /** standard empty connection creation */ Connection(); /** Clear the connection properties and close any open socket. */ @@ -134,7 +132,7 @@ public: /** Hierarchy code for this connection link */ hier_code peerType; - /** Socket used by this connection. -1 if no socket has been opened. */ + /** Socket used by this connection. Negative if not open. */ int fd; /** Quality of Service TOS values currently sent on this connection */ diff --git a/src/ftp.cc b/src/ftp.cc index f0579736d4..8faaae7b52 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -261,7 +261,7 @@ public: void buildTitleUrl(); void writeReplyBody(const char *, size_t len); void printfReplyBody(const char *fmt, ...); - virtual const Comm::ConnectionPointer & dataDescriptor() const; + virtual const Comm::ConnectionPointer & dataConnection() const; virtual void maybeReadVirginBody(); virtual void closeServer(); virtual void completeForwarding(); @@ -1178,7 +1178,7 @@ FtpStateData::parseListing() } const Comm::ConnectionPointer & -FtpStateData::dataDescriptor() const +FtpStateData::dataConnection() const { return data.conn; } diff --git a/src/http.cc b/src/http.cc index fc0b4b8538..2c1c57529b 100644 --- a/src/http.cc +++ b/src/http.cc @@ -172,7 +172,7 @@ HttpStateData::~HttpStateData() } const Comm::ConnectionPointer & -HttpStateData::dataDescriptor() const +HttpStateData::dataConnection() const { return serverConnection; } diff --git a/src/http.h b/src/http.h index f838e2acc8..9e30e29960 100644 --- a/src/http.h +++ b/src/http.h @@ -54,7 +54,7 @@ public: HttpHeader * hdr_out, const http_state_flags flags); - virtual const Comm::ConnectionPointer & dataDescriptor() const; + virtual const Comm::ConnectionPointer & dataConnection() const; /* should be private */ bool sendRequest(); void processReplyHeader(); diff --git a/src/icmp/net_db.cc b/src/icmp/net_db.cc index 51a26f17dd..3cfb03e4cd 100644 --- a/src/icmp/net_db.cc +++ b/src/icmp/net_db.cc @@ -1337,8 +1337,7 @@ netdbExchangeStart(void *data) urlCanonical(ex->r); - Comm::ConnectionPointer nul; - FwdState::fwdStart(nul, ex->e, ex->r); + FwdState::fwdStart(Comm::ConnectionPointer(), ex->e, ex->r); #endif } diff --git a/src/peer_digest.cc b/src/peer_digest.cc index 477341a2b6..84089c1b57 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -393,8 +393,7 @@ peerDigestRequest(PeerDigest * pd) /* push towards peer cache */ debugs(72, 3, "peerDigestRequest: forwarding to fwdStart..."); - Comm::ConnectionPointer nul; - FwdState::fwdStart(nul, e, req); + FwdState::fwdStart(Comm::ConnectionPointer(), e, req); tempBuffer.offset = 0; diff --git a/src/urn.cc b/src/urn.cc index 0b9affa8b2..b5f2aca8f6 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -256,8 +256,7 @@ UrnState::created(StoreEntry *newEntry) if (urlres_e->isNull()) { urlres_e = storeCreateEntry(urlres, urlres, request_flags(), METHOD_GET); sc = storeClientListAdd(urlres_e, this); - Comm::ConnectionPointer nul; - FwdState::fwdStart(nul, urlres_e, urlres_r); + FwdState::fwdStart(Comm::ConnectionPointer(), urlres_e, urlres_r); } else { urlres_e->lock();