]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugzilla #1457
authorwessels <>
Tue, 6 Dec 2005 07:01:23 +0000 (07:01 +0000)
committerwessels <>
Tue, 6 Dec 2005 07:01:23 +0000 (07:01 +0000)
My changes to the way that the client-side performed http_access,
redirector, and no_cache checks introduced a serious bug.  Using
any proxy authentication would crash Squid.

One problem was that clientAccessCheckDone() should have returned
after generating the error page.  Instead it tried to keep going,
as though access were allowed.

The other problem was due to a recently added assertion, which was
incorrect.  Instead of asserting, the ClientRequestContext destructor
now releases its lock on the parent ClientHttpRequest if necessary.

src/client_side_request.cc

index 4ef3d7824729668831689b6b3652227e9d52fe56..2b00457b84033a9bcdade0c77954b211e5d9166d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.cc,v 1.53 2005/12/03 18:00:28 wessels Exp $
+ * $Id: client_side_request.cc,v 1.54 2005/12/06 00:01:23 wessels Exp $
  * 
  * DEBUG: section 85    Client-side Request Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -103,11 +103,12 @@ static void checkFailureRatio(err_type, hier_code);
 ClientRequestContext::~ClientRequestContext()
 {
     /*
-     * Note: ClientRequestContext is only deleted by its parent,
-     * ClientHttpRequest.  That can only happen after ClientRequestContext
-     * calls cbdataReferenceDone(http)
+     * Release our "lock" on our parent, ClientHttpRequest, if we
+     * still have one
      */
-    assert(NULL == http);
+
+    if (http)
+        cbdataReferenceDone(http);
 
     if (acl_checklist)
         delete acl_checklist;
@@ -451,6 +452,7 @@ ClientRequestContext::clientAccessCheckDone(int answer)
                                     auth_user_request : http->request->auth_user_request);
         node = (clientStreamNode *)http->client_stream.tail->data;
         clientStreamRead(node, http, node->readBuffer);
+        return;
     }
 
     /* ACCESS_ALLOWED continues here ... */