--------------------- PatchSet 6260 Date: 2004/08/04 17:20:24 Author: dwsquid Branch: icap-2_5 Tag: (none) Log: Patch From olivier - Fixes for 204 support and negotiation Members: src/icap_respmod.c:1.1.2.40->1.1.2.41 Index: squid/src/icap_respmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_respmod.c,v retrieving revision 1.1.2.40 retrieving revision 1.1.2.41 diff -u -r1.1.2.40 -r1.1.2.41 --- squid/src/icap_respmod.c 4 Aug 2004 17:18:11 -0000 1.1.2.40 +++ squid/src/icap_respmod.c 4 Aug 2004 17:20:24 -0000 1.1.2.41 @@ -1,6 +1,6 @@ /* - * $Id: icap_respmod.c,v 1.1.2.40 2004/08/04 17:18:11 dwsquid Exp $ + * $Id: icap_respmod.c,v 1.1.2.41 2004/08/04 17:20:24 dwsquid Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -47,7 +47,7 @@ static void getICAPRespModString(MemBuf * mb, int o1, int o2, int o3, char *service, char *client_addr, - IcapStateData * icap) + IcapStateData * icap, int allow_204) { memBufPrintf(mb, "RESPMOD %s ICAP/1.0\r\nEncapsulated:", service); if (o1 >= 0) @@ -71,6 +71,8 @@ memBufPrintf(mb, "X-TE: trailers\r\n"); } #endif + if (allow_204) + memBufPrintf(mb, "Allow: 204\r\n"); } static int @@ -132,9 +134,9 @@ icap->respmod.res_body_sz = httpReplyBodySize(icap->request->method, r); httpReplyDestroy(r); if (icap->respmod.res_body_sz) - getICAPRespModString(mb, 0, o2, o3, service->uri, client_addr, icap); + getICAPRespModString(mb, 0, o2, o3, service->uri, client_addr, icap, service->flags.allow_204); else - getICAPRespModString(mb, 0, o2, -o3, service->uri, client_addr, icap); + getICAPRespModString(mb, 0, o2, -o3, service->uri, client_addr, icap, service->flags.allow_204); if (Config.icapcfg.preview_enable) if (icap->preview_size >= 0) memBufPrintf(mb, "Preview: %d\r\n", icap->preview_size); @@ -405,14 +407,16 @@ return; #if SUPPORT_ICAP_204 } else if (status == 204) { + debug(81, 5) ("icapRespModReadReply: 204 No modification received\n"); + icap->flags.wait_for_preview_reply = 0; if (icap->flags.http_server_eof) { /* Reset is required to avoid duplicate stmemFreeDataUpto , * but will I loose all info now ? */ /* storeEntryReset(icap->respmod.entry); */ /* stmemFreeDataUpto(&(entry->mem_obj->data_hdr), -icap->sc); */ - fwdComplete(httpState->fwd); + fwdComplete(icap->httpState->fwd); } else { - commSetSelect(fd, COMM_SELECT_READ, httpReadReply, + commSetSelect(fd, COMM_SELECT_READ, icapRespModReadReply, icap, 0); } comm_close(fd);