--------------------- PatchSet 4055 Date: 2007/02/14 22:52:30 Author: rousskov Branch: squid3-icap Tag: (none) Log: - When sending last-chunk in Preview, send ieof extension if we wrote the entire body. The old code would not send ieof if we wrote as many bytes as promised in the Preview header, even if we promised to write everything. This would mislead compliant ICAP servers that do not look at the Content-Length header and reply with 100 Continue, expecting more body data. Members: src/ICAP/ICAPModXact.cc:1.1.2.20->1.1.2.21 Index: squid3/src/ICAP/ICAPModXact.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPModXact.cc,v retrieving revision 1.1.2.20 retrieving revision 1.1.2.21 diff -u -r1.1.2.20 -r1.1.2.21 --- squid3/src/ICAP/ICAPModXact.cc 14 Feb 2007 06:10:21 -0000 1.1.2.20 +++ squid3/src/ICAP/ICAPModXact.cc 14 Feb 2007 22:52:30 -0000 1.1.2.21 @@ -1144,7 +1144,7 @@ preview.wrote(0, true); Must(preview.done()); - Must(!preview.ieof()); + Must(preview.ieof()); } void ICAPModXact::fillPendingStatus(MemBuf &buf) const @@ -1391,13 +1391,16 @@ void ICAPPreview::wrote(size_t size, bool wroteEof) { Must(enabled()); + theWritten += size; + Must(theWritten <= theAd); + + if (wroteEof) + theState = stIeof; // written size is irrelevant + else if (theWritten >= theAd) - theState = stDone; // wroteEof is irrelevant - else - if (wroteEof) - theState = stIeof; + theState = stDone; } bool ICAPModXact::fillVirginHttpHeader(MemBuf &mb) const