--------------------- PatchSet 5773 Date: 2003/06/03 16:10:57 Author: hno Branch: icap-2_5 Tag: (none) Log: Build a fake request in REQMOD to have the request forwarded as a proxy request to the ICAP server, allowing clientReadRequest() to parse the returned request. Members: src/icap.c:1.1.16.4->1.1.16.5 Index: squid/src/icap.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap.c,v retrieving revision 1.1.16.4 retrieving revision 1.1.16.5 diff -u -r1.1.16.4 -r1.1.16.5 --- squid/src/icap.c 9 May 2003 17:00:03 -0000 1.1.16.4 +++ squid/src/icap.c 3 Jun 2003 16:10:57 -0000 1.1.16.5 @@ -1,5 +1,5 @@ /* - * $Id: icap.c,v 1.1.16.4 2003/05/09 17:00:03 hno Exp $ + * $Id: icap.c,v 1.1.16.5 2003/06/03 16:10:57 hno Exp $ * This file has the ICAP client code... * * Author: Geetha Manjunath, @@ -351,7 +351,8 @@ MemBuf mb_hdr; HttpStateData *httpState = data; IcapStateData *icap = httpState->icap; - request_t *req = httpState->request; + request_t *req = httpState->orig_request; + request_t *proxy_req; StoreEntry *entry = httpState->entry; char *client_addr; int cfd; @@ -389,14 +390,18 @@ memBufDefInit(&mb); memBufDefInit(&mb_hdr); + /* memBufPrintf(&buf, ...); * * memBufAppend(MemBuf * mb, const char *buf, mb_size_t sz) * * comm_write_mbuf(fd, buf, handler, data); * * -- memBufClean(&buf); * * memBufPrintf(mb, "%s %s HTTP/1.0\r\n", */ - httpBuildRequestPrefix(req, - httpState->orig_request, entry, &mb_hdr, cfd, httpState->flags); + proxy_req = requestCreate(req->method, PROTO_NONE, storeUrl(httpState->entry)); + requestLink(proxy_req); + httpBuildRequestPrefix(proxy_req, + req, entry, &mb_hdr, cfd, httpState->flags); + requestUnlink(proxy_req); service = icap->current_service; assert(service);