--------------------- PatchSet 5005 Date: 2002/09/16 23:30:52 Author: rbcollins Branch: fixrange Tag: (none) Log: Apply Introduce Parameter object to clientStreamInit Members: src/clientStream.c:1.2.8.4->1.2.8.5 src/clientStream.h:1.1.2.5->1.1.2.6 src/client_side.c:1.72.2.1->1.72.2.2 src/client_side_request.c:1.3.6.5->1.3.6.6 Index: squid/src/clientStream.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/clientStream.c,v retrieving revision 1.2.8.4 retrieving revision 1.2.8.5 diff -u -r1.2.8.4 -r1.2.8.5 --- squid/src/clientStream.c 16 Sep 2002 23:02:52 -0000 1.2.8.4 +++ squid/src/clientStream.c 16 Sep 2002 23:30:52 -0000 1.2.8.5 @@ -1,6 +1,6 @@ /* - * $Id: clientStream.c,v 1.2.8.4 2002/09/16 23:02:52 rbcollins Exp $ + * $Id: clientStream.c,v 1.2.8.5 2002/09/16 23:30:52 rbcollins Exp $ * * DEBUG: section 87 Client-side Stream routines. * AUTHOR: Robert Collins @@ -127,7 +127,7 @@ void clientStreamInit(dlink_list * list, CSR * func, CSD * rdetach, CSS * readstatus, void *readdata, CSCB * callback, CSD * cdetach, void *callbackdata, - char *tailbuf, size_t taillen) + StoreIOBuffer tailBuffer) { clientStreamNode *temp = clientStreamNew(func, NULL, rdetach, readstatus, readdata); @@ -136,8 +136,7 @@ temp->head = list; clientStreamInsertHead(list, NULL, callback, cdetach, NULL, callbackdata); temp = list->tail->data; - temp->readBuffer.data = tailbuf; - temp->readBuffer.length = taillen; + temp->readBuffer = tailBuffer; } /* Index: squid/src/clientStream.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/clientStream.h,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid/src/clientStream.h 16 Sep 2002 23:21:59 -0000 1.1.2.5 +++ squid/src/clientStream.h 16 Sep 2002 23:30:52 -0000 1.1.2.6 @@ -1,6 +1,6 @@ /* - * $Id: clientStream.h,v 1.1.2.5 2002/09/16 23:21:59 rbcollins Exp $ + * $Id: clientStream.h,v 1.1.2.6 2002/09/16 23:30:52 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -58,7 +58,7 @@ }; /* clientStream.c */ -extern void clientStreamInit(dlink_list *, CSR *, CSD *, CSS *, void *, CSCB *, CSD *, void *, char *, size_t); +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); Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.72.2.1 retrieving revision 1.72.2.2 diff -u -r1.72.2.1 -r1.72.2.2 --- squid/src/client_side.c 16 Sep 2002 21:47:53 -0000 1.72.2.1 +++ squid/src/client_side.c 16 Sep 2002 23:30:52 -0000 1.72.2.2 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.72.2.1 2002/09/16 21:47:53 rbcollins Exp $ + * $Id: client_side.c,v 1.72.2.2 2002/09/16 23:30:52 rbcollins Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -705,6 +705,7 @@ { clientHttpRequest *http; clientSocketContext *context; + StoreIOBuffer tempBuffer = EMPTYIOBUFFER; http = cbdataAlloc(clientHttpRequest); http->conn = conn; http->start = current_time; @@ -712,9 +713,11 @@ http->uri = xstrdup(uri); http->log_uri = xstrndup(uri, MAX_URL); context = clientSocketContextNew(http); + tempBuffer.data = context->reqbuf; + tempBuffer.length = HTTP_REQBUF_SZ; clientStreamInit(&http->client_stream, clientGetMoreData, clientReplyDetach, clientReplyStatus, clientReplyNewContext(http), clientSocketRecipient, - clientSocketDetach, context, context->reqbuf, HTTP_REQBUF_SZ); + clientSocketDetach, context, tempBuffer); dlinkAdd(http, &http->active, &ClientActiveRequests); return context; } @@ -822,6 +825,7 @@ #if LINUX_NETFILTER size_t sock_sz = sizeof(conn->me); #endif + StoreIOBuffer tempBuffer = EMPTYIOBUFFER; /* pre-set these values to make aborting simpler */ *prefix_p = NULL; @@ -876,9 +880,11 @@ http->start = current_time; http->req_sz = prefix_sz; context = clientSocketContextNew(http); + tempBuffer.data = context->reqbuf; + tempBuffer.length = HTTP_REQBUF_SZ; clientStreamInit(&http->client_stream, clientGetMoreData, clientReplyDetach, clientReplyStatus, clientReplyNewContext(http), clientSocketRecipient, - clientSocketDetach, context, context->reqbuf, HTTP_REQBUF_SZ); + clientSocketDetach, context, tempBuffer); *prefix_p = xmalloc(prefix_sz + 1); xmemcpy(*prefix_p, conn->in.buf, prefix_sz); *(*prefix_p + prefix_sz) = '\0'; 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.5 retrieving revision 1.3.6.6 diff -u -r1.3.6.5 -r1.3.6.6 --- squid/src/client_side_request.c 16 Sep 2002 23:21:59 -0000 1.3.6.5 +++ squid/src/client_side_request.c 16 Sep 2002 23:30:53 -0000 1.3.6.6 @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.c,v 1.3.6.5 2002/09/16 23:21:59 rbcollins Exp $ + * $Id: client_side_request.c,v 1.3.6.6 2002/09/16 23:30:53 rbcollins Exp $ * * DEBUG: section 85 Client-side Request Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -113,15 +113,18 @@ {1, 0}; clientHttpRequest *http = cbdataAlloc(clientHttpRequest); request_t *request; + StoreIOBuffer tempBuffer = EMPTYIOBUFFER; http->http_ver = http_ver; http->conn = NULL; http->start = current_time; /* this is only used to adjust the connection offset in client_side.c */ http->req_sz = 0; + tempBuffer.length = taillen; + tempBuffer.data = tailbuf; /* client stream setup */ clientStreamInit(&http->client_stream, clientGetMoreData, clientReplyDetach, clientReplyStatus, clientReplyNewContext(http), streamcallback, - streamdetach, streamdata, tailbuf, taillen); + streamdetach, streamdata, tempBuffer); /* make it visible in the 'current acctive requests list' */ dlinkAdd(http, &http->active, &ClientActiveRequests); /* Set flags */