--------------------- PatchSet 1588 Date: 2005/08/24 17:37:08 Author: dwsquid Branch: squid3-icap Tag: (none) Log: - Need to call adapted->sendSourceStart() in ICAPXaction::parseHeaders to tell the HTTP side that we've got the reply headers. - Temporarily changed MemBuf's max_capacity to 1M to workaround a bug that can overflow the MemBuf. Members: src/ICAPAnchor.cc:1.1.2.12->1.1.2.13 src/ICAPXaction.cc:1.1.2.6->1.1.2.7 Index: squid3/src/ICAPAnchor.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPAnchor.cc,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -r1.1.2.12 -r1.1.2.13 --- squid3/src/ICAPAnchor.cc 24 Aug 2005 15:42:29 -0000 1.1.2.12 +++ squid3/src/ICAPAnchor.cc 24 Aug 2005 17:37:08 -0000 1.1.2.13 @@ -31,7 +31,7 @@ virgin->data->body = new mem_hdr; #else virgin->data->body = new MemBuf; - memBufDefInit(virgin->data->body); + memBufInit(virgin->data->body, MAX_CLIENT_BUF_SZ, 1<<20); #endif adapted = new MsgPipe("adapted"); Index: squid3/src/ICAPXaction.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/ICAPXaction.cc,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- squid3/src/ICAPXaction.cc 24 Aug 2005 17:18:07 -0000 1.1.2.6 +++ squid3/src/ICAPXaction.cc 24 Aug 2005 17:37:08 -0000 1.1.2.7 @@ -119,17 +119,17 @@ adapted->data = new MsgPipeData; adapted->data->header = httpReplyCreate(); // who is deleting? refcount? adapted->data->body = new MemBuf; // XXX: make body a non-pointer? - memBufInit(adapted->data->body, ICAPMsgPipeBufSize, ICAPMsgPipeBufSize); + memBufInit(adapted->data->body, ICAPMsgPipeBufSize, 1<<20); // headers are initialized when we parse them // writing end // nothing to do because we are using temporary write buffers // reading end - memBufInit(&readBuf, MAX_CLIENT_BUF_SZ, MAX_CLIENT_BUF_SZ); + memBufInit(&readBuf, MAX_CLIENT_BUF_SZ, 1<<20); // encoding - memBufInit(&requestBuf, MAX_CLIENT_BUF_SZ, MAX_CLIENT_BUF_SZ); + memBufInit(&requestBuf, MAX_CLIENT_BUF_SZ, 1<<20); // parsing icapReply = httpReplyCreate(); @@ -244,7 +244,7 @@ void ICAPXaction::moveRequestChunk(MemBuf *buf) { if (memBufIsNull(buf)) - memBufDefInit(buf); + memBufInit(buf, MAX_CLIENT_BUF_SZ, 1<<20); MsgPipeData::Body *body = virgin->data->body; const mb_size_t chunkSize = body->contentSize(); // may be zero @@ -366,7 +366,7 @@ if (state.parsingHeaders()) // need more data Must(!state.doneReading); else - adapter->noteSourceStart(); + adapted->sendSourceStart(); } void ICAPXaction::parseHeader(HttpReply *header) { @@ -518,7 +518,7 @@ Must(httpResp); MemBuf httpBuf; - memBufDefInit(&httpBuf); + memBufInit(&httpBuf, MAX_CLIENT_BUF_SZ, 1<<20); // httpReq->urlpath.size() + 25 + // request line, roughly // httpReq->header.len + // request header size // httpResp->hdr_sz); // response request line + header, roughly