--------------------- PatchSet 10346 Date: 2007/12/29 13:39:42 Author: adri Branch: s27_adri Tag: (none) Log: convert httpProcessReplyHeaderBlock() to take a buf_t now intead of a (const char *, len). Members: src/http.c:1.63.2.3.4.28->1.63.2.3.4.29 Index: squid/src/http.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/http.c,v retrieving revision 1.63.2.3.4.28 retrieving revision 1.63.2.3.4.29 diff -u -r1.63.2.3.4.28 -r1.63.2.3.4.29 --- squid/src/http.c 29 Dec 2007 13:36:05 -0000 1.63.2.3.4.28 +++ squid/src/http.c 29 Dec 2007 13:39:42 -0000 1.63.2.3.4.29 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.63.2.3.4.28 2007/12/29 13:36:05 adri Exp $ + * $Id: http.c,v 1.63.2.3.4.29 2007/12/29 13:39:42 adri Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -424,15 +424,20 @@ * chunk. */ static size_t -httpProcessReplyHeaderBlock(HttpStateData * httpState, const char *o_buf, int o_size, int parse_start) +httpProcessReplyHeaderBlock(HttpStateData * httpState, buf_t *b, int parse_start) { StoreEntry *entry = httpState->entry; size_t hdr_len; size_t hdr_size; HttpReply *reply = entry->mem_obj->reply; Ctx ctx = ctx_enter(entry->mem_obj->url); - const char *buf = o_buf + parse_start; - int size = o_size - parse_start; + const char *buf = NULL; + int size = 0; + + if (b) { + buf = buf_buf(b) + parse_start; + size = buf_len(b) - parse_start; + } assert(size >= 0); @@ -492,7 +497,7 @@ httpState->reply_hdr_state = 0; ctx_exit(ctx); if (hdr_size < size) - return hdr_size + httpProcessReplyHeaderBlock(httpState, buf, size, hdr_size); + return hdr_size + httpProcessReplyHeaderBlock(httpState, b, hdr_size); else return hdr_size; } @@ -972,7 +977,7 @@ /* Fake an "end-of-headers" to work around such broken servers */ buf_append(httpState->replybuf, "\r\n", 2, BF_NONE); assert(buf_start < buf_len(httpState->replybuf)); - httpProcessReplyHeaderBlock(httpState, buf_buf(httpState->replybuf), buf_len(httpState->replybuf), buf_start); + httpProcessReplyHeaderBlock(httpState, httpState->replybuf, buf_start); } if (entry->mem_obj->reply->sline.status == HTTP_HEADER_TOO_LARGE) { storeEntryReset(entry); @@ -996,7 +1001,7 @@ */ storeBuffer(entry); assert(buf_start < buf_len(httpState->replybuf)); - done = httpProcessReplyHeaderBlock(httpState, buf_buf(httpState->replybuf), buf_len(httpState->replybuf), buf_start); + done = httpProcessReplyHeaderBlock(httpState, httpState->replybuf, buf_start); debug(11, 2) ("httpReadReply: FD %d: httpProcessReplyHeaderBlock consumed %d bytes\n", httpState->fd, done); if (httpState->reply_hdr_state == 2) { http_status s = entry->mem_obj->reply->sline.status;