From: rousskov <> Date: Tue, 8 May 2007 23:26:54 +0000 (+0000) Subject: Author: Guido Serassio X-Git-Tag: SQUID_3_0_PRE6~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cfd3f67fa8ecd6f73ac01d422e344c260d4c5ff8;p=thirdparty%2Fsquid.git Author: Guido Serassio Removed unused ICAPClientStream code. The functions provided by ICAP/ICAPClientStream.{cc,h} were called from client_side_reply.cc but the code was #ifdef-ed with ICAP_CLIENT_RESPMOD_POSTCACHE, which was not defined anywhere. Somebody was either trying to get ICAP RESPMOD post-cache work with client streams long time ago (but did not get far) or just wanted to provide hooks for future use. --- diff --git a/src/ICAP/ICAPClientStream.cc b/src/ICAP/ICAPClientStream.cc deleted file mode 100644 index 940b831cda..0000000000 --- a/src/ICAP/ICAPClientStream.cc +++ /dev/null @@ -1,103 +0,0 @@ - - - -#include "squid.h" -#include "ICAPClient.h" -#include "clientStream.h" -#include "client_side_reply.h" -#include "HttpHeader.h" -#include "HttpReply.h" - -struct _junk -{ - clientStreamNode *node; - clientHttpRequest *http; - HttpReply *rep; - StoreIOBuffer *receivedData; -}; - -static EVH someEvent; - - -/* - * This callback is called for each incoming data chunk. - * Note receivedData only gives us the message body, not - * the headers - */ -void -icapclientProcessStream(clientStreamNode *thisNode, clientHttpRequest *http, HttpReply *rep, StoreIOBuffer receivedData) -{ - assert (thisNode != NULL); - assert (cbdataReferenceValid (thisNode)); - - debugs(0, 0, "This is icapclientProcessStream"); - debugs(0, 0, "\tthisNode=" << thisNode); - debugs(0, 0, "\thttp=" << http); - debugs(0, 0, "\trep=" << rep); - debugs(0, 0, "\trep->content_length=" << rep->content_length); - char *foo; - foo = new char[receivedData.length+1]; - xstrncpy(foo, receivedData.data, receivedData.length+1); - *(foo+receivedData.length) = '\0'; - debugs(0, 0, "{" << foo << "}"); - - struct _junk *j = (struct _junk *) xcalloc(1, sizeof(*j)); - j->node = thisNode; - j->http = http; - j->rep = rep; - j->receivedData = &receivedData; - - eventAdd("someEvent", someEvent, j, 5.0, 0, 0); - -} - -void -icapclientStreamRead(clientStreamNode *thisNode, clientHttpRequest *http) -{ - debugs(0, 0, "This is icapclientStreamRead"); - - /* pass data through untouched */ - clientStreamNode *next = thisNode->next(); - clientStreamRead (thisNode, http, next->readBuffer); - return; -} - -void -icapclientStreamDetach(clientStreamNode *thisNode, clientHttpRequest *http) -{ - debugs(0, 0, "This is icapclientStreamDetach"); -} - -clientStream_status_t -icapclientStreamStatus(clientStreamNode *thisNode, clientHttpRequest *http) -{ - debugs(0, 0, "This is icapclientStreamStatus"); - - /* pass data through untouched */ - return clientStreamStatus (thisNode, http); - - return STREAM_NONE; -} - -static void -someEvent(void *foo) -{ - debugs(0, 0, "this is someEvent"); - - struct _junk *j = (struct _junk *) foo; - - - if (NULL != j->rep) { - httpHeaderPutExt(&j->rep->header, "X-foo", "bar-bar"); - } - - if (NULL == j->node->data.getRaw()) { - /* first call; setup our state */ - } - - /* pass data through untouched */ - clientStreamCallback (j->node, j->http, j->rep, *j->receivedData); - - free(j); - -} diff --git a/src/ICAP/ICAPClientStream.h b/src/ICAP/ICAPClientStream.h deleted file mode 100644 index df34b8de51..0000000000 --- a/src/ICAP/ICAPClientStream.h +++ /dev/null @@ -1,14 +0,0 @@ - -#ifndef SQUID_ICAP_CLIENT_H -#define SQUID_ICAP_CLIENT_H - - -#include "clientStream.h" - -extern CSR icapclientStreamRead; -extern CSCB icapclientProcessStream; -extern CSD icapclientStreamDetach; -extern CSS icapclientStreamStatus; - - -#endif diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index f0fea72411..ef72b8f485 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.123 2007/05/07 18:12:28 wessels Exp $ + * $Id: client_side_reply.cc,v 1.124 2007/05/08 17:26:54 rousskov Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -47,9 +47,6 @@ #if ESI #include "ESI.h" #endif -#if ICAP_CLIENT_RESPMOD_POSTCACHE -#include "ICAPClient.h" -#endif #include "MemObject.h" #include "ACLChecklist.h" #include "ACL.h" @@ -1829,18 +1826,6 @@ clientReplyContext::processReplyAccessResult(bool accessAllowed) esiProcessStream, esiStreamDetach, esiStreamStatus, NULL); } -#endif - -#if ICAP_CLIENT_RESPMOD_POSTCACHE - - debugs(88, 0, "Enabling ICAP processing for " << http->uri); - - clientStreamInsertHead(&http->client_stream, icapclientStreamRead, - icapclientProcessStream, - icapclientStreamDetach, - icapclientStreamStatus, - NULL); - #endif if (http->request->method == METHOD_HEAD) {