]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Merging async-call branch changes to HEAD:
authorrousskov <>
Wed, 13 Feb 2008 07:00:57 +0000 (07:00 +0000)
committerrousskov <>
Wed, 13 Feb 2008 07:00:57 +0000 (07:00 +0000)
Async-call work replaces event-based asynchronous calls with
stand-alone implementation. The common async call API allows Squid
core do call, debug, and troubleshoot all callback handlers in a
uniform way.

An async "job" API is introduced to manage independent logical threads
or work such as protocol transaction handlers on client, server, and
ICAP sides. These jobs should communicate with each other using async
calls to minimize dependencies and avoid reentrant callback loops.

These changes will eventually improve overall code quality, debugging
quality, and Squid robustness.

Below you will find log messages from the async-call branch that are
relevant to the file(s) being committed.

        Made comm_read and comm_write calls to use the new CommCalls.

        Converted the ConnStateData related code in client_side.cc to
        use CommCalls.

        BodyPipe now uses the  new job calls interface. Many changes in
        BodyPipe's related code.

src/client_side_request.cci

index 141036bf446eb62f545350bd1393ff93110e250f..c32b24938377fca1c619a45aab0fd5453217f754 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.cci,v 1.5 2006/05/11 21:29:02 wessels Exp $
+ * $Id: client_side_request.cci,v 1.6 2008/02/13 00:00:57 rousskov Exp $
  *
  * DEBUG: section 85    Client-side Request Routines
  * AUTHOR: Robert Collins 
@@ -49,23 +49,33 @@ ClientHttpRequest::memObject() const
     return NULL;
 }
 
-ConnStateData::Pointer
+ConnStateData *
 ClientHttpRequest::getConn()
 {
+    if(!cbdataReferenceValid(conn_))
+       return NULL;
+
     return conn_;
 }
 
-ConnStateData::Pointer const
+ConnStateData * const
 ClientHttpRequest::getConn() const
 {
+    if(!cbdataReferenceValid(conn_))
+       return NULL;
+
     return conn_;
 }
 
 void
-ClientHttpRequest::setConn(ConnStateData::Pointer aConn)
+ClientHttpRequest::setConn(ConnStateData * aConn)
 {
     assert (conn_ == NULL || aConn == NULL);
-    conn_ = aConn;
+
+    if(conn_)
+       cbdataReferenceDone(conn_);
+
+    conn_ = cbdataReference(aConn);
 }
 
 StoreEntry *