--------------------- PatchSet 3954 Date: 2006/12/14 00:21:54 Author: rousskov Branch: squid3-icap Tag: (none) Log: - Do not reset Preview size to zero when expecting a virgin body of unknown size. A Squid user reported that this change works. Members: src/ICAP/ICAPModXact.cc:1.1.2.17->1.1.2.18 Index: squid3/src/ICAP/ICAPModXact.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPModXact.cc,v retrieving revision 1.1.2.17 retrieving revision 1.1.2.18 diff -u -r1.1.2.17 -r1.1.2.18 --- squid3/src/ICAP/ICAPModXact.cc 25 Oct 2006 04:57:03 -0000 1.1.2.17 +++ squid3/src/ICAP/ICAPModXact.cc 14 Dec 2006 00:21:54 -0000 1.1.2.18 @@ -1067,10 +1067,11 @@ // cannot preview more than we can backup size_t ad = XMIN(wantedSize, TheBackupLimit); - if (virginBody.expected() && virginBody.knownSize()) - ad = XMIN(ad, virginBody.size()); // not more than we have + if (!virginBody.expected()) + ad = 0; // nothing to preview but headers else - ad = 0; // questionable optimization? + if (virginBody.knownSize()) + ad = XMIN(ad, virginBody.size()); // not more than we have debugs(93, 5, "ICAPModXact should offer " << ad << "-byte preview " << "(service wanted " << wantedSize << ")");