From: wessels <> Date: Sat, 21 Apr 2007 04:24:07 +0000 (+0000) Subject: Removed some uses of RefCount::getRaw() X-Git-Tag: SQUID_3_0_PRE6~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d3a24ca72349e1a824f2f4bc0a7af1f7aff3735;p=thirdparty%2Fsquid.git Removed some uses of RefCount::getRaw() We can compare RefCount pointers to NULL without using getRaw() as long as the RefCount pointer is on the left, and NULL is on the right. --- diff --git a/src/ACLChecklist.cc b/src/ACLChecklist.cc index ed26e9ff21..3e6fa4428b 100644 --- a/src/ACLChecklist.cc +++ b/src/ACLChecklist.cc @@ -1,5 +1,5 @@ /* - * $Id: ACLChecklist.cc,v 1.34 2006/05/18 21:51:10 wessels Exp $ + * $Id: ACLChecklist.cc,v 1.35 2007/04/20 22:24:07 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -235,7 +235,7 @@ ACLChecklist::checkCallback(allow_t answer) /* the checklist lock */ auth_user_request->unlock(); /* it might have been connection based */ - assert(conn().getRaw() != NULL); + assert(conn() != NULL); conn()->auth_user_request = NULL; conn()->auth_type = AUTH_BROKEN; auth_user_request = NULL; @@ -371,7 +371,7 @@ ACLChecklist::conn() void ACLChecklist::conn(ConnStateData::Pointer aConn) { - assert (conn().getRaw() == NULL); + assert (conn() == NULL); conn_ = aConn; } diff --git a/src/ACLIdent.cc b/src/ACLIdent.cc index e764e16ab3..18a5e4583f 100644 --- a/src/ACLIdent.cc +++ b/src/ACLIdent.cc @@ -82,7 +82,7 @@ ACLIdent::match(ACLChecklist *checklist) { if (checklist->rfc931[0]) { return data->match(checklist->rfc931); - } else if (checklist->conn().getRaw() != NULL && checklist->conn()->rfc931[0]) { + } else if (checklist->conn() != NULL && checklist->conn()->rfc931[0]) { return data->match(checklist->conn()->rfc931); } else { debug(28, 3) ("ACLIdent::match() - switching to ident lookup state\n"); @@ -125,7 +125,7 @@ IdentLookup::Instance() void IdentLookup::checkForAsync(ACLChecklist *checklist)const { - if (checklist->conn().getRaw() != NULL) { + if (checklist->conn() != NULL) { debug(28, 3) ("IdentLookup::checkForAsync: Doing ident lookup\n"); checklist->asyncInProgress(true); identStart(&checklist->conn()->me, &checklist->conn()->peer, @@ -153,7 +153,7 @@ IdentLookup::LookupDone(const char *ident, void *data) * Cache the ident result in the connection, to avoid redoing ident lookup * over and over on persistent connections */ - if (checklist->conn().getRaw() != NULL && !checklist->conn()->rfc931[0]) + if (checklist->conn() != NULL && !checklist->conn()->rfc931[0]) xstrncpy(checklist->conn()->rfc931, checklist->rfc931, USER_IDENT_SZ); checklist->asyncInProgress(false); diff --git a/src/ACLProxyAuth.cc b/src/ACLProxyAuth.cc index c0a456f5e9..efba6a5311 100644 --- a/src/ACLProxyAuth.cc +++ b/src/ACLProxyAuth.cc @@ -163,7 +163,7 @@ ProxyAuthLookup::LookupDone(void *data, char *result) /* OR the connection was closed, there's no way to continue */ checklist->auth_user_request->unlock(); - if (checklist->conn().getRaw() != NULL) { + if (checklist->conn() != NULL) { checklist->conn()->auth_user_request = NULL; checklist->conn()->auth_type = AUTH_BROKEN; } diff --git a/src/AuthUserRequest.cc b/src/AuthUserRequest.cc index 25e3353cec..357d25d650 100644 --- a/src/AuthUserRequest.cc +++ b/src/AuthUserRequest.cc @@ -1,6 +1,6 @@ /* - * $Id: AuthUserRequest.cc,v 1.11 2007/01/03 12:57:47 hno Exp $ + * $Id: AuthUserRequest.cc,v 1.12 2007/04/20 22:24:07 wessels Exp $ * * DO NOT MODIFY NEXT 2 LINES: * arch-tag: 6803fde1-d5a2-4c29-9034-1c0c9f650eb4 @@ -298,7 +298,7 @@ authTryGetUser (auth_user_request_t **auth_user_request, ConnStateData::Pointer return *auth_user_request; else if (request != NULL && request->auth_user_request) return request->auth_user_request; - else if (conn.getRaw() != NULL) + else if (conn != NULL) return conn->auth_user_request; else return NULL; @@ -340,13 +340,13 @@ AuthUserRequest::authenticate(auth_user_request_t ** auth_user_request, http_hdr */ if (((proxy_auth == NULL) && (!authenticateUserAuthenticated(authTryGetUser(auth_user_request,conn,request)))) - || (conn.getRaw() != NULL && conn->auth_type == AUTH_BROKEN)) + || (conn != NULL && conn->auth_type == AUTH_BROKEN)) { /* no header or authentication failed/got corrupted - restart */ debug(29, 4) ("authenticateAuthenticate: broken auth or no proxy_auth header. Requesting auth header.\n"); /* something wrong with the AUTH credentials. Force a new attempt */ - if (conn.getRaw() != NULL) { + if (conn != NULL) { conn->auth_type = AUTH_UNKNOWN; if (conn->auth_user_request) @@ -369,7 +369,7 @@ AuthUserRequest::authenticate(auth_user_request_t ** auth_user_request, http_hdr * No check for function required in the if: its compulsory for conn based * auth modules */ - if (proxy_auth && conn.getRaw() != NULL && conn->auth_user_request && + if (proxy_auth && conn != NULL && conn->auth_user_request && authenticateUserAuthenticated(conn->auth_user_request) && conn->auth_user_request->connLastHeader() != NULL && strcmp(proxy_auth, conn->auth_user_request->connLastHeader())) @@ -398,9 +398,9 @@ AuthUserRequest::authenticate(auth_user_request_t ** auth_user_request, http_hdr if (*auth_user_request == NULL) { debug(29, 9) ("authenticateAuthenticate: This is a new checklist test on FD:%d\n", - conn.getRaw() != NULL ? conn->fd : -1); + conn != NULL ? conn->fd : -1); - if (proxy_auth && !request->auth_user_request && conn.getRaw() && conn->auth_user_request) { + if (proxy_auth && !request->auth_user_request && conn != NULL && conn->auth_user_request) { AuthConfig * scheme = AuthConfig::Find(proxy_auth); if (!conn->auth_user_request->user() || conn->auth_user_request->user()->config != scheme) { @@ -413,7 +413,7 @@ AuthUserRequest::authenticate(auth_user_request_t ** auth_user_request, http_hdr } if ((!request->auth_user_request) - && (conn.getRaw() == NULL || conn->auth_type == AUTH_UNKNOWN)) { + && (conn == NULL || conn->auth_type == AUTH_UNKNOWN)) { /* beginning of a new request check */ debug(29, 4) ("authenticateAuthenticate: no connection authentication type\n"); @@ -451,7 +451,7 @@ AuthUserRequest::authenticate(auth_user_request_t ** auth_user_request, http_hdr ; } else { - assert (conn.getRaw() != NULL); + assert (conn != NULL); if (conn->auth_user_request != NULL) { *auth_user_request = conn->auth_user_request; diff --git a/src/DelayId.cc b/src/DelayId.cc index a6684fe756..28fc96146e 100644 --- a/src/DelayId.cc +++ b/src/DelayId.cc @@ -1,6 +1,6 @@ /* - * $Id: DelayId.cc,v 1.19 2006/02/17 18:10:59 wessels Exp $ + * $Id: DelayId.cc,v 1.20 2007/04/20 22:24:07 wessels Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -109,7 +109,7 @@ DelayId::DelayClient(ClientHttpRequest * http) ch.my_addr = r->my_addr; ch.my_port = r->my_port; - if (http->getConn().getRaw() != NULL) + if (http->getConn() != NULL) ch.conn(http->getConn()); ch.request = HTTPMSGLOCK(r); @@ -155,7 +155,7 @@ DelayId::bytesWanted(int minimum, int maximum) const /* limited */ int nbytes = max(minimum, maximum); - if (compositeId.getRaw()) + if (compositeId != NULL) nbytes = compositeId->bytesWanted(minimum, nbytes); return nbytes; @@ -177,14 +177,14 @@ DelayId::bytesIn(int qty) assert ((unsigned short)(pool() - 1) != 0xFFFF); - if (compositeId.getRaw()) + if (compositeId != NULL) compositeId->bytesIn(qty); } void DelayId::delayRead(DeferredRead const &aRead) { - assert (compositeId.getRaw()); + assert (compositeId != NULL); compositeId->delayRead(aRead); } diff --git a/src/DelayPool.cc b/src/DelayPool.cc index 5e9b783c68..4dc8ed73c8 100644 --- a/src/DelayPool.cc +++ b/src/DelayPool.cc @@ -1,6 +1,6 @@ /* - * $Id: DelayPool.cc,v 1.5 2003/08/04 22:14:40 robertc Exp $ + * $Id: DelayPool.cc,v 1.6 2007/04/20 22:24:07 wessels Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: Robert Collins @@ -62,14 +62,14 @@ DelayPool::~DelayPool() void DelayPool::parse() { - assert (theComposite().getRaw()); + assert (theComposite() != NULL); theComposite()->parse(); } void DelayPool::dump (StoreEntry *entry, unsigned int i) const { - if (!theComposite().getRaw()) + if (!theComposite() != NULL) return; storeAppendPrintf(entry, "delay_class %d %s\n", i + 1, pool->theClassTypeLabel());