]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Enabled request->cache_control and removed REQ_CC_ONLY_IF_CACHED
authorrousskov <>
Tue, 12 May 1998 02:56:06 +0000 (02:56 +0000)
committerrousskov <>
Tue, 12 May 1998 02:56:06 +0000 (02:56 +0000)
- Fixed memory leak for request->cache_control field

src/HttpRequest.cc
src/client_side.cc
src/structs.h

index 3b49d8a6fc15b7cc12e4590117f008fd0bda46eb..bf4d8cc499485fd7ea513179b3d54e3afaa7073c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpRequest.cc,v 1.2 1998/05/11 18:44:28 rousskov Exp $
+ * $Id: HttpRequest.cc,v 1.3 1998/05/11 20:56:06 rousskov Exp $
  *
  * DEBUG: section 73    HTTP Request
  * AUTHOR: Duane Wessels
@@ -52,6 +52,8 @@ requestDestroy(request_t * req)
     safe_free(req->body);
     stringClean(&req->urlpath);
     httpHeaderClean(&req->header);
+    if (req->cache_control)
+       httpHdrCcDestroy(req->cache_control);
     memFree(MEM_REQUEST_T, req);
 }
 
@@ -71,7 +73,11 @@ requestUnlink(request_t * request)
     request->link_count--;
     if (request->link_count > 0)
        return;
-    requestDestroy(request);
+    if (request->link_count == 0)
+       requestDestroy(request);
+    else
+       debug(73, 1) ("requestUnlink: BUG: negative link_count: %d. Ignored.\n",
+           request->link_count);
 }
 
 int
index 2af0e2cfeacffa4e35596831931c8e642b7f31e0..48220979c5b85e0896a439a0f28cfb776482a013 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.301 1998/05/11 18:44:34 rousskov Exp $
+ * $Id: client_side.cc,v 1.302 1998/05/11 20:56:07 rousskov Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -124,12 +124,8 @@ clientOnlyIfCached(clientHttpRequest * http)
 {
     const request_t *r = http->request;
     assert(r);
-    if (EBIT_TEST(r->flags, REQ_CC_ONLY_IF_CACHED)) {
-       /* future interface: 
-        * if (r->cache_control && EBIT_TEST(r->cache_control->mask, CC_ONLY_IF_CACHED)) { */
-       return 1;
-    } else
-       return 0;
+    return  r->cache_control && 
+       EBIT_TEST(r->cache_control->mask, CC_ONLY_IF_CACHED);
 }
 
 static HttpReply *
index b58a008d0d7eb52003de60eb1f99ed91af96543f..f930297bdea4a92848ba57da22d0395fb2b5fff8 100644 (file)
@@ -1088,7 +1088,7 @@ struct _request_t {
     String urlpath;
     int link_count;            /* free when zero */
     int flags;
-    HttpHdrCc *cache_control;  /* not used yet */
+    HttpHdrCc *cache_control;
     time_t max_age;
     float http_ver;
     time_t ims;