]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Various bugfixes.
authorrobertc <>
Sun, 18 May 2003 06:03:55 +0000 (06:03 +0000)
committerrobertc <>
Sun, 18 May 2003 06:03:55 +0000 (06:03 +0000)
Keywords:

* ACLChecklist::checkCallback: used deleteSelf() rather than delete this;
* ClientRequestContext::~ClientRequestContext: ditto.
* clientAccessCheckDone: Prevent race conditions leading to double deletes of acl_checklist.
* comm_accept_check_event: Add comment for clarity.
* StoreEntry::storeClientType: Add comments for clarity.
* StoreEntry::complete(): Ditto.
* Move .cci files to noinst_headers section.

src/ACLChecklist.cc
src/Makefile.am
src/client_side_request.cc
src/comm.cc
src/store.cc

index 38f88b5a031ef2bd7dc6c5955a7e021a1805a0d1..663ada6df247e912c81e568c7afe05f47f831810 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLChecklist.cc,v 1.11 2003/05/17 17:35:03 hno Exp $
+ * $Id: ACLChecklist.cc,v 1.12 2003/05/18 00:04:07 robertc Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -232,7 +232,7 @@ ACLChecklist::checkCallback(allow_t answer)
     if (cbdataReferenceValidDone(callback_data, &cbdata_))
         callback_(answer, cbdata_);
 
-    delete this;
+    deleteSelf();
 }
 
 void
index 5fe2bbf3b2c1a1daad874358c2f04f0f0dc2c097..43867fd3c2fc5a5db16d7986f568aa843c8cad26 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.am,v 1.74 2003/05/17 17:35:03 hno Exp $
+#  $Id: Makefile.am,v 1.75 2003/05/18 00:04:07 robertc Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -266,7 +266,6 @@ squid_SOURCES = \
        acl.cc \
        ACL.h \
        ACLChecklist.cc \
-       ACLChecklist.cci \
        ACLChecklist.h \
        $(squid_ACLSOURCES) \
        asn.cc \
@@ -427,7 +426,8 @@ squid_SOURCES = \
        whois.cc \
        $(WIN32SOURCE)
 
-noinst_HEADERS = MemBuf.cci \
+noinst_HEADERS = ACLChecklist.cci \
+       MemBuf.cci \
        MemBuf.h \
        Store.cci \
        String.cci \
index ea1cd3c586f9920d5a3dd2350aed7445093b9af8..16ee27747f009c6ff2df9605a51118b94f07f32d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.cc,v 1.21 2003/05/11 13:53:03 hno Exp $
+ * $Id: client_side_request.cc,v 1.22 2003/05/18 00:04:07 robertc Exp $
  * 
  * DEBUG: section 85    Client-side Request Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -130,7 +130,7 @@ ClientRequestContext::~ClientRequestContext()
         cbdataReferenceDone(http);
 
     if (acl_checklist)
-        delete acl_checklist;
+        acl_checklist->deleteSelf();
 }
 
 ClientRequestContext::ClientRequestContext() : acl_checklist (NULL), redirect_state (REDIRECT_NONE), http(NULL)
@@ -379,6 +379,7 @@ clientAccessCheckDone(int answer, void *data)
 {
     ClientRequestContext *context = (ClientRequestContext *)data;
 
+    context->acl_checklist = NULL;
     clientHttpRequest *http_ = context->http;
 
     if (!cbdataReferenceValid (http_)) {
@@ -397,7 +398,6 @@ clientAccessCheckDone(int answer, void *data)
     proxy_auth_msg = authenticateAuthUserRequestMessage((http->conn
                      && http->conn->auth_user_request) ? http->conn->
                      auth_user_request : http->request->auth_user_request);
-    context->acl_checklist = NULL;
 
     if (answer == ACCESS_ALLOWED) {
         safe_free(http->uri);
index 4a270de0b77dd4f4c8b33a653f534935f630366d..cdc34ddcef0657173bad98cbdc0fa0fce2970b63 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.374 2003/04/24 06:35:08 hno Exp $
+ * $Id: comm.cc,v 1.375 2003/05/18 00:03:55 robertc Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -983,6 +983,7 @@ comm_accept_check_event(void *data)
     int fd = ((fdc_t *)(data))->fd;
 
     if (fdNFree() < RESERVED_FD) {
+        /* activate accept checking rather than period event based checks */
         commSetSelect(fd, COMM_SELECT_READ, comm_accept_try, NULL, 0);
         return;
     }
index 0623f59d8af521725055518b392152b5fae12219..df058d9b2bec6082afa3724be188618f9422480a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.565 2003/03/15 04:17:41 robertc Exp $
+ * $Id: store.cc,v 1.566 2003/05/18 00:04:07 robertc Exp $
  *
  * DEBUG: section 20    Storage Manager
  * AUTHOR: Harvest Derived
@@ -236,6 +236,12 @@ StoreEntry::setNoDelay (bool const newValue)
 store_client_t
 StoreEntry::storeClientType() const
 {
+    /* The needed offset isn't in memory
+     * XXX TODO: this is wrong for range requests
+     * as the needed offset may *not* be 0, AND
+     * offset 0 in the memory object is the HTTP headers.
+     */
+
     if (mem_obj->inmem_lo)
         return STORE_DISK_CLIENT;
 
@@ -246,7 +252,10 @@ StoreEntry::storeClientType() const
     }
 
     if (store_status == STORE_OK) {
+        /* the object has completed. */
+
         if (mem_obj->inmem_lo == 0 && !isEmpty())
+            /* hot object */
             return STORE_MEM_CLIENT;
         else
             return STORE_DISK_CLIENT;
@@ -1000,8 +1009,13 @@ StoreEntry::complete()
         return;
     }
 
+    /* This is suspect: mem obj offsets include the headers. do we adjust for that
+     * in use of object_sz?
+     */
     mem_obj->object_sz = mem_obj->endOffset();
+
     store_status = STORE_OK;
+
     assert(mem_status == NOT_IN_MEMORY);
 
     if (!validLength()) {