From: hno <> Date: Thu, 21 Sep 2006 04:26:24 +0000 (+0000) Subject: ICAP cleanup of some cbdataReference misunderstanding. X-Git-Tag: SQUID_3_0_PRE5~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e2eb5c3666665c7fbe39f190932aaa90f505678;p=thirdparty%2Fsquid.git ICAP cleanup of some cbdataReference misunderstanding. cbdataReference should only be used to create additional callback references to a cbdata object. The owner of the object is the owner and has automatic rights to the object, and should not call cbdataReference. --- diff --git a/src/Server.cc b/src/Server.cc index a3a489bbc2..04a67683c1 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -1,5 +1,5 @@ /* - * $Id: Server.cc,v 1.5 2006/05/19 17:19:09 wessels Exp $ + * $Id: Server.cc,v 1.6 2006/09/20 22:26:24 hno Exp $ * * DEBUG: * AUTHOR: Duane Wessels @@ -62,12 +62,8 @@ ServerStateData::~ServerStateData() fwd = NULL; // refcounted #if ICAP_CLIENT - - if (icap) { + if (icap) delete icap; - cbdataReferenceDone(icap); - } - #endif } @@ -83,7 +79,6 @@ ServerStateData::doIcap(ICAPServiceRep::Pointer service) debug(11,5)("ServerStateData::doIcap() called\n"); assert(NULL == icap); icap = new ICAPClientRespmodPrecache(service); - (void) cbdataReference(icap); return 0; } diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 4379f170d8..fa39c302bb 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.cc,v 1.72 2006/09/02 06:49:48 robertc Exp $ + * $Id: client_side_request.cc,v 1.73 2006/09/20 22:26:24 hno Exp $ * * DEBUG: section 85 Client-side Request Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -122,9 +122,8 @@ ClientRequestContext::~ClientRequestContext() debugs(85,3, HERE << this << " ClientHttpRequest destructed"); } -ClientRequestContext::ClientRequestContext(ClientHttpRequest *anHttp) : http(anHttp), acl_checklist (NULL), redirect_state (REDIRECT_NONE) +ClientRequestContext::ClientRequestContext(ClientHttpRequest *anHttp) : http(cbdataReference(anHttp)), acl_checklist (NULL), redirect_state (REDIRECT_NONE) { - (void) cbdataReference(http); http_access_done = false; redirect_done = false; no_cache_done = false; @@ -259,10 +258,8 @@ ClientHttpRequest::~ClientHttpRequest() freeResources(); #if ICAP_CLIENT - if (icap) { + if (icap) delete icap; - cbdataReferenceDone(icap); - } #endif if (calloutContext) delete calloutContext; @@ -1084,7 +1081,6 @@ ClientHttpRequest::doIcap(ICAPServiceRep::Pointer service) debugs(85, 3, HERE << this << " ClientHttpRequest::doIcap() called"); assert(NULL == icap); icap = new ICAPClientReqmodPrecache(service); - (void) cbdataReference(icap); icap->startReqMod(this, request); if (request->body_reader == NULL) {