--------------------- PatchSet 6000 Date: 2003/10/29 20:31:36 Author: dwsquid Branch: icap-2_5 Tag: (none) Log: For successful ICAP REQMOD replies, link the fake clientHttpRequest to *new* request_t instead of the old one. This also solves the request_t memory leak. Members: src/icap_reqmod.c:1.1.2.12->1.1.2.13 Index: squid/src/icap_reqmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_reqmod.c,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -r1.1.2.12 -r1.1.2.13 --- squid/src/icap_reqmod.c 29 Oct 2003 17:40:25 -0000 1.1.2.12 +++ squid/src/icap_reqmod.c 29 Oct 2003 20:31:36 -0000 1.1.2.13 @@ -1,5 +1,5 @@ /* - * $Id: icap_reqmod.c,v 1.1.2.12 2003/10/29 17:40:25 dwsquid Exp $ + * $Id: icap_reqmod.c,v 1.1.2.13 2003/10/29 20:31:36 dwsquid Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -75,14 +75,14 @@ * from the ICAP server. */ static clientHttpRequest * -icapReqModCreateClientState(IcapStateData *icap) +icapReqModCreateClientState(IcapStateData * icap, request_t * request) { clientHttpRequest *http; http = cbdataAlloc(clientHttpRequest); http->uri = xstrdup(urlCanonicalClean(icap->request)); http->log_uri = xstrndup(http->uri, MAX_URL); http->range_iter.boundary = StringNull; - http->request = requestLink(icap->request); + http->request = requestLink(request ? request : icap->request); http->flags.did_icap_reqmod = 1; http->start = icap->reqmod.start; http->conn = cbdataAlloc(ConnStateData); @@ -106,7 +106,7 @@ static void icapReqModInterpretHttpRequest(IcapStateData * icap, request_t * request) { - clientHttpRequest *http = icapReqModCreateClientState(icap); + clientHttpRequest *http = icapReqModCreateClientState(icap, request); assert(http); /* * bits from clientReadRequest @@ -163,7 +163,7 @@ icapEntryError(IcapStateData * icap, err_type et, http_status hs, int xerrno) { ErrorState *err; - clientHttpRequest *http = icapReqModCreateClientState(icap); + clientHttpRequest *http = icapReqModCreateClientState(icap, NULL); assert(http); http->entry = clientCreateStoreEntry(http, icap->request->method, @@ -289,7 +289,7 @@ icapReqModHandoffRespMod(IcapStateData * icap) { extern PF icapReadReply; - clientHttpRequest *http = icapReqModCreateClientState(icap); + clientHttpRequest *http = icapReqModCreateClientState(icap, NULL); assert(http); assert(icap->request);