--------------------- PatchSet 6022 Date: 2003/11/06 22:26:28 Author: dwsquid Branch: icap-2_5 Tag: (none) Log: Change the way that 'chunk_buf' and memBufRead() work. Instead of using SQUID_TCP_SO_RCVBUF as the capcity, use the default capacity and grow the buffer as needed before reading. Members: src/MemBuf.c:1.5.44.1->1.5.44.2 src/icap_reqmod.c:1.1.2.21->1.1.2.22 Index: squid/src/MemBuf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/MemBuf.c,v retrieving revision 1.5.44.1 retrieving revision 1.5.44.2 diff -u -r1.5.44.1 -r1.5.44.2 --- squid/src/MemBuf.c 4 Nov 2003 18:22:33 -0000 1.5.44.1 +++ squid/src/MemBuf.c 6 Nov 2003 22:26:28 -0000 1.5.44.2 @@ -1,6 +1,6 @@ /* - * $Id: MemBuf.c,v 1.5.44.1 2003/11/04 18:22:33 dwsquid Exp $ + * $Id: MemBuf.c,v 1.5.44.2 2003/11/06 22:26:28 dwsquid Exp $ * * DEBUG: section 59 auto-growing Memory Buffer with printf * AUTHOR: Alex Rousskov @@ -370,7 +370,8 @@ memBufRead(int fd, MemBuf *mb) { int len; - assert(mb->capacity > mb->size); + if (mb->capacity == mb->size) + memBufGrow(mb, SQUID_TCP_SO_RCVBUF); len = FD_READ_METHOD(fd, mb->buf + mb->size, mb->capacity - mb->size); if (len) mb->size += len; Index: squid/src/icap_reqmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_reqmod.c,v retrieving revision 1.1.2.21 retrieving revision 1.1.2.22 diff -u -r1.1.2.21 -r1.1.2.22 --- squid/src/icap_reqmod.c 6 Nov 2003 07:32:39 -0000 1.1.2.21 +++ squid/src/icap_reqmod.c 6 Nov 2003 22:26:28 -0000 1.1.2.22 @@ -1,5 +1,5 @@ /* - * $Id: icap_reqmod.c,v 1.1.2.21 2003/11/06 07:32:39 dwsquid Exp $ + * $Id: icap_reqmod.c,v 1.1.2.22 2003/11/06 22:26:28 dwsquid Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -318,7 +318,7 @@ /* icap->http_flags = ? */ memBufDefInit(&icap->respmod.buffer); - memBufInit(&icap->chunk_buf, SQUID_TCP_SO_RCVBUF, SQUID_TCP_SO_RCVBUF); + memBufDefInit(&icap->chunk_buf); assert(icap->current_service); icapReadReply(icap->icap_fd, icap); } @@ -419,7 +419,7 @@ icapReqModKeepAliveOrClose(icap); } else if (icap->request->body_reader) { icap->chunk_size = 0; - memBufInit(&icap->chunk_buf, SQUID_TCP_SO_RCVBUF, SQUID_TCP_SO_RCVBUF); + memBufDefInit(&icap->chunk_buf); commSetSelect(fd, COMM_SELECT_READ, icapReqModReadHttpBody, icap, 0); } else { icapReqModKeepAliveOrClose(icap);