]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed NULL pointer bug from a storeClientCopy callback. We sort of
authorwessels <>
Wed, 18 Feb 1998 01:15:22 +0000 (01:15 +0000)
committerwessels <>
Wed, 18 Feb 1998 01:15:22 +0000 (01:15 +0000)
overloaded "size < 0" for these callbacks.  Sometimes its a store-side
failure (didn't open swap file), and sometimes its a client-side
cancellation.  If its cancelled from the client side we check that
http->entry != NULL before proceeding with the request.

src/client_side.cc

index 44e8668993385a1f0cc6856a7d091e8bc336cff8..db15196135a72b782444d49983b5fd8dd81356b7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.207 1998/02/12 07:03:04 wessels Exp $
+ * $Id: client_side.cc,v 1.208 1998/02/17 18:15:22 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1078,9 +1078,17 @@ clientGetHeadersForIMS(void *data, char *buf, ssize_t size)
     memFree(MEM_4K_BUF, buf);
     buf = NULL;
     if (size < 0 || entry->store_status == STORE_ABORTED) {
-       debug(33, 1) ("clientGetHeadersForIMS: storeClientCopy failed for '%s'\n",
-           storeKeyText(entry->key));
-       clientProcessMiss(http);
+       /*
+        * There are different reasons why we might have size < 0.  One
+        * being that we failed to open a swapfile.  Another being that
+        * the request was cancelled from the client-side.  If the client
+        * cancelled the request, then http->entry will be NULL.
+        */
+       if (entry != NULL) {
+           debug(33, 1) ("clientGetHeadersForIMS: storeClientCopy failed for '%s'\n",
+               storeKeyText(entry->key));
+           clientProcessMiss(http);
+       }
        return;
     }
     if (mem->reply->code == 0) {