--------------------- PatchSet 8915 Date: 2007/02/13 11:41:26 Author: adri Branch: storework Tag: (none) Log: Change most of the http server code to use the "newer" http reply code rather than parse + storeAppend. Members: src/http.c:1.56.2.1->1.56.2.2 Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.56.2.1 retrieving revision 1.56.2.2 diff -u -r1.56.2.1 -r1.56.2.2 --- squid/src/http.c 13 Feb 2007 10:47:33 -0000 1.56.2.1 +++ squid/src/http.c 13 Feb 2007 11:41:26 -0000 1.56.2.2 @@ -377,6 +377,7 @@ hdr_len = hdr_size; if (hdr_len > Config.maxReplyHeaderSize) { debug(11, 1) ("httpProcessReplyHeader: Too large reply header\n"); + /* [ahc] XXX not sure how to handle this and we should think about it; so fail out for now */ storeAppend(entry, httpState->reply_hdr.buf, httpState->reply_hdr.size); memBufClean(&httpState->reply_hdr); reply->sline.status = HTTP_HEADER_TOO_LARGE; @@ -404,7 +405,7 @@ /* Parse headers into reply structure */ /* what happens if we fail to parse here? */ httpReplyParse(reply, httpState->reply_hdr.buf, hdr_size); - storeAppend(entry, httpState->reply_hdr.buf, hdr_size); + httpReplySwapOut(reply, entry); done = hdr_size - old_size; if (reply->sline.status >= HTTP_INVALID_HEADER) { debug(11, 3) ("httpProcessReplyHeader: Non-HTTP-compliant header: '%s'\n", httpState->reply_hdr.buf); @@ -845,17 +846,12 @@ comm_close(fd); return; } else if (s == HTTP_INVALID_HEADER) { - MemBuf mb; HttpReply *reply = entry->mem_obj->reply; httpReplyReset(reply); httpBuildVersion(&reply->sline.version, 1, 0); reply->sline.status = HTTP_OK; httpHeaderPutTime(&reply->header, HDR_DATE, squid_curtime); - mb = httpReplyPack(reply); - storeAppend(entry, mb.buf, mb.size); - httpReplyReset(reply); - httpReplyParse(reply, mb.buf, mb.size); - memBufClean(&mb); + httpReplySwapOut(reply, entry); } #if WIP_FWD_LOG fwdStatus(httpState->fwd, s);