--------------------- PatchSet 3819 Date: 2006/10/03 04:43:52 Author: rousskov Branch: squid3-icap Tag: (none) Log: - The ieof HTTP chunk-extension was written after chunk-data instead of being written after the chunk-size. (Tsantilas Christos ) Members: src/ICAP/ICAPModXact.cc:1.1.2.4->1.1.2.5 src/ICAP/ICAPModXact.h:1.1.2.3->1.1.2.4 Index: squid3/src/ICAP/ICAPModXact.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPModXact.cc,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid3/src/ICAP/ICAPModXact.cc 3 Oct 2006 04:24:34 -0000 1.1.2.4 +++ squid3/src/ICAP/ICAPModXact.cc 3 Oct 2006 04:43:52 -0000 1.1.2.5 @@ -295,9 +295,9 @@ void ICAPModXact::moveRequestChunk(MemBuf &buf, size_t chunkSize) { if (chunkSize > 0) { - openChunk(buf, chunkSize); + openChunk(buf, chunkSize, false); buf.append(claimContent(virginWriteClaim), chunkSize); - closeChunk(buf, false); + closeChunk(buf); virginWriteClaim.release(chunkSize); virginConsume(); @@ -313,20 +313,18 @@ void ICAPModXact::addLastRequestChunk(MemBuf &buf) { - openChunk(buf, 0); - closeChunk(buf, state.writing == State::writingPreview && preview.ieof()); + const bool ieof = state.writing == State::writingPreview && preview.ieof(); + openChunk(buf, 0, ieof); + closeChunk(buf); } -void ICAPModXact::openChunk(MemBuf &buf, size_t chunkSize) +void ICAPModXact::openChunk(MemBuf &buf, size_t chunkSize, bool ieof) { - buf.Printf("%x\r\n", (int) chunkSize); + buf.Printf((ieof ? "%x; ieof\r\n" : "%x\r\n"), (int) chunkSize); } -void ICAPModXact::closeChunk(MemBuf &buf, bool ieof) +void ICAPModXact::closeChunk(MemBuf &buf) { - if (ieof) - buf.append("; ieof", 6); - buf.append(ICAP::crlf, 2); // chunk-terminating CRLF } Index: squid3/src/ICAP/ICAPModXact.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPModXact.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid3/src/ICAP/ICAPModXact.h 3 Oct 2006 04:24:34 -0000 1.1.2.3 +++ squid3/src/ICAP/ICAPModXact.h 3 Oct 2006 04:43:52 -0000 1.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: ICAPModXact.h,v 1.1.2.3 2006/10/03 04:24:34 rousskov Exp $ + * $Id: ICAPModXact.h,v 1.1.2.4 2006/10/03 04:43:52 rousskov Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -173,8 +173,8 @@ void makeRequestHeaders(MemBuf &buf); void moveRequestChunk(MemBuf &buf, size_t chunkSize); void addLastRequestChunk(MemBuf &buf); - void openChunk(MemBuf &buf, size_t chunkSize); - void closeChunk(MemBuf &buf, bool ieof); + void openChunk(MemBuf &buf, size_t chunkSize, bool ieof); + void closeChunk(MemBuf &buf); void virginConsume(); bool shouldPreview();