--------------------- PatchSet 444 Date: 2002/12/20 21:24:46 Author: rbcollins Branch: esi Tag: (none) Log: use Segment::append, and simplify logic a little Members: src/ESI.cc:1.1.2.58->1.1.2.59 Index: squid3/src/ESI.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESI.cc,v retrieving revision 1.1.2.58 retrieving revision 1.1.2.59 diff -u -r1.1.2.58 -r1.1.2.59 --- squid3/src/ESI.cc 20 Dec 2002 20:18:44 -0000 1.1.2.58 +++ squid3/src/ESI.cc 20 Dec 2002 21:24:46 -0000 1.1.2.59 @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.1.2.58 2002/12/20 20:18:44 rbcollins Exp $ + * $Id: ESI.cc,v 1.1.2.59 2002/12/20 21:24:46 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -1848,17 +1848,13 @@ off_t start = 0; int remainingCharacters = numberOfCharacters; while (remainingCharacters > 0) { - off_t len = sizeof (local->buf) - local->len; - if (len > remainingCharacters) - len = remainingCharacters; - xmemcpy (&local->buf[local->len], &s[start], len); - local->len += len; - remainingCharacters -= len; - s += len; - if (local->len == sizeof (local->buf) && remainingCharacters){ + if (local->len == sizeof (local->buf)){ local->next = new ESISegment; local=local->next; } + size_t len = local->append (&s[start], remainingCharacters); + start += len; + remainingCharacters -= len; } varState = cbdataReference (context->varState); }