]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Guido Serassio <guido.serassio@acmeconsulting.it>
authorrousskov <>
Tue, 8 May 2007 23:26:54 +0000 (23:26 +0000)
committerrousskov <>
Tue, 8 May 2007 23:26:54 +0000 (23:26 +0000)
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.

src/ICAP/ICAPClientStream.cc [deleted file]
src/ICAP/ICAPClientStream.h [deleted file]
src/client_side_reply.cc

diff --git a/src/ICAP/ICAPClientStream.cc b/src/ICAP/ICAPClientStream.cc
deleted file mode 100644 (file)
index 940b831..0000000
+++ /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 (file)
index df34b8d..0000000
+++ /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
index f0fea724118161c72d2463bdf61f33e1d78017c5..ef72b8f485b6d741c5cc2f659d652e5dbe17dc10 100644 (file)
@@ -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) {