--------------------- PatchSet 6025 Date: 2003/11/07 05:52:53 Author: dwsquid Branch: icap-2_5 Tag: (none) Log: change buildRespModHeader()'s local 'bs' (bytes sent) into a member of IcapStateData so that we don't incorrectly send a zero-sized end chunk for body-less transactions. Members: src/icap_respmod.c:1.1.2.18->1.1.2.19 src/structs.h:1.48.2.9.2.19->1.48.2.9.2.20 Index: squid/src/icap_respmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_respmod.c,v retrieving revision 1.1.2.18 retrieving revision 1.1.2.19 diff -u -r1.1.2.18 -r1.1.2.19 --- squid/src/icap_respmod.c 6 Nov 2003 22:28:45 -0000 1.1.2.18 +++ squid/src/icap_respmod.c 7 Nov 2003 05:52:53 -0000 1.1.2.19 @@ -1,5 +1,5 @@ /* - * $Id: icap_respmod.c,v 1.1.2.18 2003/11/06 22:28:45 dwsquid Exp $ + * $Id: icap_respmod.c,v 1.1.2.19 2003/11/07 05:52:53 dwsquid Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -78,7 +78,6 @@ int o3; int hlen; int consumed; - int bs; icap_service *service; HttpReply *r; @@ -125,9 +124,9 @@ r = httpReplyCreate(); httpReplyParse(r, icap->respmod.req_hdr_copy.buf, icap->respmod.req_hdr_copy.size); - bs = httpReplyBodySize(icap->request->method, r); + icap->respmod.res_body_sz = httpReplyBodySize(icap->request->method, r); httpReplyDestroy(r); - if (bs) + if (icap->respmod.res_body_sz) getICAPRespModString(mb, 0, o2, o3, service->uri, client_addr); else getICAPRespModString(mb, 0, o2, -o3, service->uri, client_addr); @@ -290,7 +289,7 @@ memBufAppend(&mb, crlf, 2); icap->sc += len; } - if (icap->flags.send_zero_chunk) { + if (icap->flags.send_zero_chunk && icap->respmod.res_body_sz) { /* send zero end chunk */ icap->flags.send_zero_chunk = 0; icap->flags.http_server_eof = 1; Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.48.2.9.2.19 retrieving revision 1.48.2.9.2.20 diff -u -r1.48.2.9.2.19 -r1.48.2.9.2.20 --- squid/src/structs.h 4 Nov 2003 18:22:34 -0000 1.48.2.9.2.19 +++ squid/src/structs.h 7 Nov 2003 05:52:53 -0000 1.48.2.9.2.20 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.48.2.9.2.19 2003/11/04 18:22:34 dwsquid Exp $ + * $Id: structs.h,v 1.48.2.9.2.20 2003/11/07 05:52:53 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1029,6 +1029,7 @@ MemBuf buffer; MemBuf req_hdr_copy; /* XXX barf */ MemBuf resp_copy; /* XXX barf^max */ + int res_body_sz; } respmod; struct { unsigned int connect_pending:1;