--------------------- PatchSet 5000 Date: 2002/09/16 22:52:01 Author: rbcollins Branch: fixrange Tag: (none) Log: Use StoreIOBuffer's length field Members: src/clientStream.c:1.2.8.2->1.2.8.3 src/clientStream.h:1.1.2.2->1.1.2.3 src/client_side_reply.c:1.4.6.7->1.4.6.8 src/client_side_request.c:1.3.6.2->1.3.6.3 Index: squid/src/clientStream.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/clientStream.c,v retrieving revision 1.2.8.2 retrieving revision 1.2.8.3 diff -u -r1.2.8.2 -r1.2.8.3 --- squid/src/clientStream.c 16 Sep 2002 22:29:57 -0000 1.2.8.2 +++ squid/src/clientStream.c 16 Sep 2002 22:52:01 -0000 1.2.8.3 @@ -1,6 +1,6 @@ /* - * $Id: clientStream.c,v 1.2.8.2 2002/09/16 22:29:57 rbcollins Exp $ + * $Id: clientStream.c,v 1.2.8.3 2002/09/16 22:52:01 rbcollins Exp $ * * DEBUG: section 87 Client-side Stream routines. * AUTHOR: Robert Collins @@ -137,7 +137,7 @@ clientStreamInsertHead(list, NULL, callback, cdetach, NULL, callbackdata); temp = list->tail->data; temp->readBuffer.data = tailbuf; - temp->readlen = taillen; + temp->readBuffer.length = taillen; } /* @@ -198,7 +198,7 @@ debug(87, 3) ("clientStreamRead: Calling %p with cbdata %p from node %p\n", prev->readfunc, prev->data, this); this->readoff = readoff; - this->readlen = readlen; + this->readBuffer.length = readlen; this->readBuffer.data = readbuf; prev->readfunc(prev, http); } Index: squid/src/clientStream.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/clientStream.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/src/clientStream.h 16 Sep 2002 22:29:57 -0000 1.1.2.2 +++ squid/src/clientStream.h 16 Sep 2002 22:52:01 -0000 1.1.2.3 @@ -1,6 +1,6 @@ /* - * $Id: clientStream.h,v 1.1.2.2 2002/09/16 22:29:57 rbcollins Exp $ + * $Id: clientStream.h,v 1.1.2.3 2002/09/16 22:52:01 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -45,7 +45,6 @@ CSS *status; void *data; /* Context for the node */ StoreIOBuffer readBuffer; /* what this node wants */ - size_t readlen; /* how much data *this* node can handle */ off_t readoff; /* where *this* node wants it's data read from in the stream */ }; 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.7 retrieving revision 1.4.6.8 diff -u -r1.4.6.7 -r1.4.6.8 --- squid/src/client_side_reply.c 16 Sep 2002 22:47:56 -0000 1.4.6.7 +++ squid/src/client_side_reply.c 16 Sep 2002 22:52:02 -0000 1.4.6.8 @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.c,v 1.4.6.7 2002/09/16 22:47:56 rbcollins Exp $ + * $Id: client_side_reply.c,v 1.4.6.8 2002/09/16 22:52:02 rbcollins Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -617,7 +617,7 @@ /* get the next chain members buffer */ next = http->client_stream.head->next->data; - storeClientCopy(context->sc, e, next->readoff, next->readlen, + storeClientCopy(context->sc, e, next->readoff, next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); } } else { @@ -679,7 +679,7 @@ errorAppendEntry(http->entry, err); /* and trigger a read of the resulting object */ next = http->client_stream.head->next->data; - storeClientCopy(context->sc, http->entry, next->readoff, next->readlen, + storeClientCopy(context->sc, http->entry, next->readoff, next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); return; } else { @@ -688,7 +688,7 @@ http->entry = clientCreateStoreEntry(context, r->method, r->flags); /* And trigger a read of the resultant object */ next = http->client_stream.head->next->data; - storeClientCopy(context->sc, http->entry, next->readoff, next->readlen, + storeClientCopy(context->sc, http->entry, next->readoff, next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); if (http->redirect.status) { HttpReply *rep = httpReplyCreate(); @@ -733,7 +733,7 @@ clientCreateStoreEntry(context, r->method, null_request_flags); /* And trigger a read of the resultant object */ next = http->client_stream.head->next->data; - storeClientCopy(context->sc, http->entry, next->readoff, next->readlen, + storeClientCopy(context->sc, http->entry, next->readoff, next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); errorAppendEntry(http->entry, err); } @@ -760,7 +760,7 @@ clientCreateStoreEntry(context, http->request->method, null_request_flags); /* And trigger a read of the resultant object */ - storeClientCopy(context->sc, http->entry, next->readoff, next->readlen, + storeClientCopy(context->sc, http->entry, next->readoff, next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); errorAppendEntry(http->entry, err); return; @@ -788,7 +788,7 @@ context->reqofs = 0; storeClientCopy(context->sc, http->entry, http->out.offset, - next->readlen, next->readBuffer.data, clientCacheHit, context); + next->readBuffer.length, next->readBuffer.data, clientCacheHit, context); return; } } @@ -832,7 +832,7 @@ clientCreateStoreEntry(context, http->request->method, null_request_flags); /* And trigger a read of the resultant object */ - storeClientCopy(context->sc, http->entry, next->readoff, next->readlen, + storeClientCopy(context->sc, http->entry, next->readoff, next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); httpReplyReset(r = http->entry->mem_obj->reply); httpBuildVersion(&version, 1, 0); @@ -852,7 +852,7 @@ clientCreateStoreEntry(context, context->http->request->method, null_request_flags); storeClientCopy(context->sc, context->http->entry, - next->readoff + context->headers_sz, next->readlen, next->readBuffer.data, + next->readoff + context->headers_sz, next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); storeReleaseRequest(context->http->entry); storeBuffer(context->http->entry); @@ -1296,7 +1296,7 @@ context->ourNode = this; /* no cbdatareference, this is only used once, and safely */ if (context->flags.storelogiccomplete) { storeClientCopy(context->sc, http->entry, - next->readoff + context->headers_sz, next->readlen, next->readBuffer.data, + next->readoff + context->headers_sz, next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); return; } @@ -1339,7 +1339,7 @@ assert(http->out.offset == http->out.size && http->out.offset == 0); storeClientCopy(context->sc, http->entry, context->reqofs, - next->readlen, next->readBuffer.data, clientCacheHit, context); + next->readBuffer.length, next->readBuffer.data, clientCacheHit, context); } else { /* MISS CASE, http->logType is already set! */ clientProcessMiss(context); @@ -1379,7 +1379,7 @@ if (buf != result.data) { /* we've got to copy some data */ - assert(result.length <= next->readlen); + assert(result.length <= next->readBuffer.length); xmemcpy(buf, result.data, result.length); body_buf = buf; } @@ -1454,7 +1454,7 @@ /* And trigger a read of the resultant object */ next = http->client_stream.head->next->data; storeClientCopy(context->sc, http->entry, next->readoff, - next->readlen, next->readBuffer.data, clientSendMoreData, context); + next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); errorAppendEntry(http->entry, err); httpReplyDestroy(rep); return; @@ -1493,7 +1493,7 @@ /* And trigger a read of the resultant object */ next = http->client_stream.head->next->data; storeClientCopy(context->sc, http->entry, next->readoff, - next->readlen, next->readBuffer.data, clientSendMoreData, context); + next->readBuffer.length, next->readBuffer.data, clientSendMoreData, context); errorAppendEntry(http->entry, err); httpReplyDestroy(rep); return; @@ -1505,7 +1505,7 @@ /* TODO: copy into the supplied buffer */ storeClientCopy(context->sc, entry, context->reqofs, - next->readlen - context->reqofs, + next->readBuffer.length - context->reqofs, next->readBuffer.data + context->reqofs, clientSendMoreData, context); return; } Index: squid/src/client_side_request.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/client_side_request.c,v retrieving revision 1.3.6.2 retrieving revision 1.3.6.3 diff -u -r1.3.6.2 -r1.3.6.3 --- squid/src/client_side_request.c 16 Sep 2002 22:29:57 -0000 1.3.6.2 +++ squid/src/client_side_request.c 16 Sep 2002 22:52:02 -0000 1.3.6.3 @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.c,v 1.3.6.2 2002/09/16 22:29:57 rbcollins Exp $ + * $Id: client_side_request.c,v 1.3.6.3 2002/09/16 22:52:02 rbcollins Exp $ * * DEBUG: section 85 Client-side Request Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -287,7 +287,7 @@ && http->conn->auth_user_request ? http->conn-> auth_user_request : http->request->auth_user_request); node = http->client_stream.tail->data; - clientStreamRead(node, http, node->readoff, node->readlen, + clientStreamRead(node, http, node->readoff, node->readBuffer.length, node->readBuffer.data); } } @@ -593,5 +593,5 @@ assert(http->out.offset == 0); /* Use the Stream Luke */ node = http->client_stream.tail->data; - clientStreamRead(node, http, node->readoff, node->readlen, node->readBuffer.data); + clientStreamRead(node, http, node->readoff, node->readBuffer.length, node->readBuffer.data); }