From: rousskov <> Date: Tue, 12 May 1998 02:56:06 +0000 (+0000) Subject: - Enabled request->cache_control and removed REQ_CC_ONLY_IF_CACHED X-Git-Tag: SQUID_3_0_PRE1~3342 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e0923003ac19dc38b2cb4fc341d667198ad24a4;p=thirdparty%2Fsquid.git - Enabled request->cache_control and removed REQ_CC_ONLY_IF_CACHED - Fixed memory leak for request->cache_control field --- diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index 3b49d8a6fc..bf4d8cc499 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -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 diff --git a/src/client_side.cc b/src/client_side.cc index 2af0e2cfea..48220979c5 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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 * diff --git a/src/structs.h b/src/structs.h index b58a008d0d..f930297bde 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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;