--------------------- PatchSet 1270 Date: 2005/03/24 13:11:13 Author: nlewycky Branch: prefetching Tag: (none) Log: Apply patch from bug 1229. Members: src/http.cc:1.43.2.4->1.43.2.5 Index: squid3/src/http.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/http.cc,v retrieving revision 1.43.2.4 retrieving revision 1.43.2.5 diff -u -r1.43.2.4 -r1.43.2.5 --- squid3/src/http.cc 11 Mar 2005 23:59:10 -0000 1.43.2.4 +++ squid3/src/http.cc 24 Mar 2005 13:11:13 -0000 1.43.2.5 @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.43.2.4 2005/03/11 23:59:10 nlewycky Exp $ + * $Id: http.cc,v 1.43.2.5 2005/03/24 13:11:13 nlewycky Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -960,12 +960,14 @@ IOStats.Http.read_hist[bin]++; } - if (!memBufIsNull(&reply_hdr) && flag == COMM_OK && len > 0) { + if (!memBufIsNull(&reply_hdr) && entry->isEmpty() && flag == COMM_OK && len > 0) { /* Skip whitespace */ while (len > 0 && xisspace(*buf)) xmemmove(buf, buf + 1, len--); + debug(11, 5) ("httpReadReply: FD %d: stripeed whitespace, now len=%d.\n", fd, (int)len); + if (len == 0) { /* Continue to read... */ do_next_read = 1; @@ -1077,6 +1079,7 @@ void HttpStateData::processReplyData(const char *buf, size_t len) { + debug(11,4)("HttpStateData::processReplyData(buf=%p, len=%u)\n", buf, len); if (reply_hdr_state < 2) { do_next_read = 1; maybeReadData(); @@ -1098,6 +1101,11 @@ tempBuffer.length = len - end; tempBuffer.offset = currentOffset; currentOffset += tempBuffer.length; + debug(11,4)("HttpStateData::processReplyData: len(%u) > end(%u), " + "tempBuffer={data=%p,length=%u,offset=%lu}," + "currentOffset=%lu\n", + len, end, tempBuffer.data, tempBuffer.length, + tempBuffer.offset, currentOffset); entry->write(tempBuffer); } @@ -1107,6 +1115,9 @@ tempBuffer.length = len; tempBuffer.offset = currentOffset; currentOffset += len; + debug(11,4)("HttpStateData::processReplyData: flags.headers_pushed=true " + "tempBuffer={data=%p,length=%u,offset=%lu}, currentOffset=%lu\n", + tempBuffer.data, tempBuffer.length, tempBuffer.offset, currentOffset); entry->write(tempBuffer); }