]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ICAP cleanup of some cbdataReference misunderstanding.
authorhno <>
Thu, 21 Sep 2006 04:26:24 +0000 (04:26 +0000)
committerhno <>
Thu, 21 Sep 2006 04:26:24 +0000 (04:26 +0000)
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.

src/Server.cc
src/client_side_request.cc

index a3a489bbc23ebd13b9099793a5925d094bbfb2bd..04a67683c138d8ede5dae931c3052a328045ca4c 100644 (file)
@@ -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;
 }
 
index 4379f170d8bfebb484d18518a401260561d49c93..fa39c302bbe6fc0e47e24f04cb4c87c316ed00e4 100644 (file)
@@ -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) {