--------------------- PatchSet 5007 Date: 2002/09/16 23:48:58 Author: rbcollins Branch: fixrange Tag: (none) Log: move the body_size into the StoreIOBuffer as the length Members: src/clientStream.c:1.2.8.6->1.2.8.7 src/clientStream.h:1.1.2.7->1.1.2.8 src/client_side_reply.c:1.4.6.11->1.4.6.12 Index: squid/src/clientStream.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/clientStream.c,v retrieving revision 1.2.8.6 retrieving revision 1.2.8.7 diff -u -r1.2.8.6 -r1.2.8.7 --- squid/src/clientStream.c 16 Sep 2002 23:40:59 -0000 1.2.8.6 +++ squid/src/clientStream.c 16 Sep 2002 23:48:58 -0000 1.2.8.7 @@ -1,6 +1,6 @@ /* - * $Id: clientStream.c,v 1.2.8.6 2002/09/16 23:40:59 rbcollins Exp $ + * $Id: clientStream.c,v 1.2.8.7 2002/09/16 23:48:58 rbcollins Exp $ * * DEBUG: section 87 Client-side Stream routines. * AUTHOR: Robert Collins @@ -170,7 +170,7 @@ */ void clientStreamCallback(clientStreamNode * this, clientHttpRequest * http, - HttpReply * rep, const char *body_data, ssize_t body_size, StoreIOBuffer replyBuffer) + HttpReply * rep, const char *body_data, StoreIOBuffer replyBuffer) { clientStreamNode *next; assert(this && http && this->node.next); @@ -179,7 +179,7 @@ debug(87, 3) ("clientStreamCallback: Calling %p with cbdata %p from node %p\n", next->callback, next->data, this); - next->callback(next, http, rep, body_data, body_size); + next->callback(next, http, rep, body_data, replyBuffer.flags.error ? -1 : replyBuffer.length); } /* Index: squid/src/clientStream.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/clientStream.h,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- squid/src/clientStream.h 16 Sep 2002 23:40:59 -0000 1.1.2.7 +++ squid/src/clientStream.h 16 Sep 2002 23:48:58 -0000 1.1.2.8 @@ -1,6 +1,6 @@ /* - * $Id: clientStream.h,v 1.1.2.7 2002/09/16 23:40:59 rbcollins Exp $ + * $Id: clientStream.h,v 1.1.2.8 2002/09/16 23:48:58 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -61,7 +61,7 @@ extern void clientStreamInit(dlink_list *, CSR *, CSD *, CSS *, void *, CSCB *, CSD *, void *, StoreIOBuffer tailBuffer); extern void clientStreamInsertHead(dlink_list *, CSR *, CSCB *, CSD *, CSS *, void *); extern clientStreamNode *clientStreamNew(CSR *, CSCB *, CSD *, CSS *, void *); -extern void clientStreamCallback(clientStreamNode *, clientHttpRequest *, HttpReply *, const char *, ssize_t, StoreIOBuffer replyBuffer); +extern void clientStreamCallback(clientStreamNode *, clientHttpRequest *, HttpReply *, const char *, StoreIOBuffer replyBuffer); extern void clientStreamRead(clientStreamNode *, clientHttpRequest *, off_t, size_t, char *); extern void clientStreamDetach(clientStreamNode *, clientHttpRequest *); extern void clientStreamAbort(clientStreamNode *, clientHttpRequest *); Index: squid/src/client_side_reply.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/client_side_reply.c,v retrieving revision 1.4.6.11 retrieving revision 1.4.6.12 diff -u -r1.4.6.11 -r1.4.6.12 --- squid/src/client_side_reply.c 16 Sep 2002 23:40:59 -0000 1.4.6.11 +++ squid/src/client_side_reply.c 16 Sep 2002 23:48:58 -0000 1.4.6.12 @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.c,v 1.4.6.11 2002/09/16 23:40:59 rbcollins Exp $ + * $Id: client_side_reply.c,v 1.4.6.12 2002/09/16 23:48:58 rbcollins Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -1414,8 +1414,9 @@ */ StoreIOBuffer tempBuffer = EMPTYIOBUFFER; context->flags.complete = 1; + tempBuffer.flags.error = result.flags.error; clientStreamCallback(http->client_stream.head->data, http, NULL, NULL, - 0, tempBuffer); + tempBuffer); /* clientWriteComplete(fd, NULL, 0, COMM_OK, http); */ return; } @@ -1426,8 +1427,9 @@ StoreIOBuffer tempBuffer = EMPTYIOBUFFER; if (result.length == 0) context->flags.complete = 1; + tempBuffer.length = size; clientStreamCallback(http->client_stream.head->data, http, NULL, buf, - size, tempBuffer); + tempBuffer); return; } /* handle headers */ @@ -1536,9 +1538,10 @@ { StoreIOBuffer tempBuffer = EMPTYIOBUFFER; assert(rep || (body_buf && body_size)); + tempBuffer.length = body_size; /* TODO: move the data in the buffer back by the request header size */ clientStreamCallback(http->client_stream.head->data, http, rep, body_buf, - body_size,tempBuffer); + tempBuffer); } }