]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Kill the psuedo-support for wais. Was never really implemented.
authorhno <>
Sun, 25 Feb 2007 18:32:27 +0000 (18:32 +0000)
committerhno <>
Sun, 25 Feb 2007 18:32:27 +0000 (18:32 +0000)
This change removes the wais_relay_host/port directives. WAIS support was
never really implemented but relied on forwarding the requests to some other
proxy/gateway using HTTP. Now this can just as well be done with cache_peer
so there is no point in having this duplicated and unmaintained forwarding
code around.

src/HttpRequest.cc
src/Makefile.am
src/Makefile.in
src/cache_cf.cc
src/cf.data.pre
src/client_side_request.cc
src/forward.cc
src/peer_select.cc
src/stat.cc
src/structs.h
src/wais.cc [deleted file]

index c2f740c81c8c39eee8e8547a0392c4b252a8649e..cd766587cfcaa6acbf6e34d16244bff047b255a1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpRequest.cc,v 1.69 2006/10/31 23:30:56 wessels Exp $
+ * $Id: HttpRequest.cc,v 1.70 2007/02/25 11:32:27 hno Exp $
  *
  * DEBUG: section 73    HTTP Request
  * AUTHOR: Duane Wessels
@@ -423,12 +423,6 @@ HttpRequest::cacheable() const
     if (protocol == PROTO_HTTP)
         return httpCachable(method);
 
-    /* FTP is always cachable */
-
-    /* WAIS is never cachable */
-    if (protocol == PROTO_WAIS)
-        return 0;
-
     /*
      * The below looks questionable: what non HTTP protocols use connect,
      * trace, put and post? RC
index ddce21cc1b97d089a38da6a26a35a50b0e2cfe8b..9450651d362e056057d348505fd5db0c7e7a6814 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.am,v 1.173 2006/11/01 19:55:29 serassio Exp $
+#  $Id: Makefile.am,v 1.174 2007/02/25 11:32:27 hno Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -607,7 +607,6 @@ squid_SOURCES = \
        URLScheme.h \
        urn.cc \
        useragent.cc \
-       wais.cc \
        wccp.cc \
        wccp2.cc \
        whois.cc \
index 881d03057eafa285bd534de40a49c062890bdb6e..1019fc3305f2e81b06ecd0a928fb9b39b1ecfd79 100644 (file)
@@ -17,7 +17,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.412 2006/11/06 05:15:27 adrian Exp $
+#  $Id: Makefile.in,v 1.413 2007/02/25 11:32:28 hno Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -72,7 +72,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/cfgaux/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/include/autoconf.h
 CONFIG_CLEAN_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
@@ -266,8 +266,8 @@ am__squid_SOURCES_DIST = access_log.cc AccessLogEntry.h acl.cc \
        StoreSwapLogData.cc StoreSwapLogData.h Server.cc Server.h \
        structs.h SwapDir.cc SwapDir.h time.cc tools.cc tunnel.cc \
        typedefs.h unlinkd.cc url.cc URL.h URLScheme.cc URLScheme.h \
-       urn.cc useragent.cc wais.cc wccp.cc wccp2.cc whois.cc \
-       wordlist.cc wordlist.h win32.cc WinSvc.cc
+       urn.cc useragent.cc wccp.cc wccp2.cc whois.cc wordlist.cc \
+       wordlist.h win32.cc WinSvc.cc
 am__objects_4 = ACLARP.$(OBJEXT)
 @ENABLE_ARP_ACL_TRUE@am__objects_5 = $(am__objects_4)
 am__objects_6 = $(am__objects_5) ACLASN.$(OBJEXT) ACLBrowser.$(OBJEXT) \
@@ -369,9 +369,9 @@ am_squid_OBJECTS = access_log.$(OBJEXT) acl.$(OBJEXT) \
        StoreSwapLogData.$(OBJEXT) Server.$(OBJEXT) SwapDir.$(OBJEXT) \
        time.$(OBJEXT) tools.$(OBJEXT) tunnel.$(OBJEXT) \
        $(am__objects_24) url.$(OBJEXT) URLScheme.$(OBJEXT) \
-       urn.$(OBJEXT) useragent.$(OBJEXT) wais.$(OBJEXT) \
-       wccp.$(OBJEXT) wccp2.$(OBJEXT) whois.$(OBJEXT) \
-       wordlist.$(OBJEXT) $(am__objects_25) $(am__objects_26)
+       urn.$(OBJEXT) useragent.$(OBJEXT) wccp.$(OBJEXT) \
+       wccp2.$(OBJEXT) whois.$(OBJEXT) wordlist.$(OBJEXT) \
+       $(am__objects_25) $(am__objects_26)
 nodist_squid_OBJECTS = repl_modules.$(OBJEXT) globals.$(OBJEXT) \
        string_arrays.$(OBJEXT)
 squid_OBJECTS = $(am_squid_OBJECTS) $(nodist_squid_OBJECTS)
@@ -2189,7 +2189,6 @@ squid_SOURCES = \
        URLScheme.h \
        urn.cc \
        useragent.cc \
-       wais.cc \
        wccp.cc \
        wccp2.cc \
        whois.cc \
index f52d26d7e11aaa47f6dadf2127442820604b22d0..b601df2538029881fc01918e18108069d0543f99 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.504 2007/02/05 15:16:31 hno Exp $
+ * $Id: cache_cf.cc,v 1.505 2007/02/25 11:32:29 hno Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -543,19 +543,6 @@ configDoConfigure(void)
 
 #endif
 
-    if (Config.Wais.relayHost) {
-        if (Config.Wais._peer)
-            cbdataFree(Config.Wais._peer);
-
-        CBDATA_INIT_TYPE_FREECB(peer, peerDestroy);
-
-        Config.Wais._peer = cbdataAlloc(peer);
-
-        Config.Wais._peer->host = xstrdup(Config.Wais.relayHost);
-
-        Config.Wais._peer->http_port = Config.Wais.relayPort;
-    }
-
     if (aclPurgeMethodInUse(Config.accessList.http))
         Config2.onoff.enable_purge = 1;
 
index 03dd0c55e1fc85a1b919fed13a88430b7903299b..33e851013fb679ea898bf11aa6a0ad4843fe3a81 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.428 2007/01/13 16:08:19 hno Exp $
+# $Id: cf.data.pre,v 1.429 2007/02/25 11:32:29 hno Exp $
 #
 #
 # SQUID Web Proxy Cache                http://www.squid-cache.org/
@@ -2089,21 +2089,6 @@ COMMENT_START
  -----------------------------------------------------------------------------
 COMMENT_END
 
-NAME: wais_relay_host
-TYPE: string
-DEFAULT: none
-LOC: Config.Wais.relayHost
-DOC_NONE
-
-NAME: wais_relay_port
-TYPE: ushort
-DEFAULT: 0
-LOC: Config.Wais.relayPort
-DOC_START
-       Relay WAIS request to host (1st arg) at port (2 arg).
-DOC_END
-
-
 NAME: request_header_max_size
 COMMENT: (KB)
 TYPE: b_size_t
index a21adfe71f4aaedbfdbc3450cc75b56dc9b4b170..2ec0718ab062175fd07a091c57c3b8b8396e471c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.cc,v 1.78 2007/01/28 15:37:46 serassio Exp $
+ * $Id: client_side_request.cc,v 1.79 2007/02/25 11:32:32 hno Exp $
  * 
  * DEBUG: section 85    Client-side Request Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -615,9 +615,6 @@ clientHierarchical(ClientHttpRequest * http)
     if (request->protocol == PROTO_GOPHER)
         return gopherCachable(request);
 
-    if (request->protocol == PROTO_WAIS)
-        return 0;
-
     if (request->protocol == PROTO_CACHEOBJ)
         return 0;
 
index 701cdfc8109f91067c447ab5a4bfeb762ef70eab..5ead65777622d394f2cf1ab86dc10dbf091bc1ad 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.152 2007/01/28 15:37:46 serassio Exp $
+ * $Id: forward.cc,v 1.153 2007/02/25 11:32:32 hno Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -904,10 +904,6 @@ FwdState::dispatch()
             ftpStart(this);
             break;
 
-        case PROTO_WAIS:
-            waisStart(this);
-            break;
-
         case PROTO_CACHEOBJ:
 
         case PROTO_INTERNAL:
@@ -920,6 +916,7 @@ FwdState::dispatch()
             whoisStart(this);
             break;
 
+        case PROTO_WAIS:       /* Not implemented */
         default:
             debug(17, 1) ("fwdDispatch: Cannot retrieve '%s'\n",
                           storeUrl(entry));
index 3a0c8ab9c953366d8706de39b65bbe6b406784ee..0ccc856e867db5a2ebbf79e2ac7d30fdfe147361 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.143 2006/12/10 05:25:53 hno Exp $
+ * $Id: peer_select.cc,v 1.144 2007/02/25 11:32:32 hno Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -498,11 +498,11 @@ peerGetSomeDirect(ps_state * ps)
     if (ps->direct == DIRECT_NO)
         return;
 
+    /* WAIS is not implemented natively */
     if (ps->request->protocol == PROTO_WAIS)
-        /* Its not really DIRECT, now is it? */
-        peerAddFwdServer(&ps->servers, Config.Wais._peer, HIER_DIRECT);
-    else
-        peerAddFwdServer(&ps->servers, NULL, HIER_DIRECT);
+       return;
+
+    peerAddFwdServer(&ps->servers, NULL, HIER_DIRECT);
 }
 
 static void
index 048856f8ffba3b161d88bb361cfa9ad40778abe5..d274cbba50abaa8c41dbe0b17e9ee4f4856c4b8e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: stat.cc,v 1.398 2006/08/28 09:53:51 serassio Exp $
+ * $Id: stat.cc,v 1.399 2007/02/25 11:32:32 hno Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -228,17 +228,6 @@ stat_io_get(StoreEntry * sentry)
     }
 
     storeAppendPrintf(sentry, "\n");
-    storeAppendPrintf(sentry, "WAIS I/O\n");
-    storeAppendPrintf(sentry, "number of reads: %d\n", IOStats.Wais.reads);
-    storeAppendPrintf(sentry, "Read Histogram:\n");
-
-    for (i = 0; i < 16; i++) {
-        storeAppendPrintf(sentry, "%5d-%5d: %9d %2d%%\n",
-                          i ? (1 << (i - 1)) + 1 : 1,
-                          1 << i,
-                          IOStats.Wais.read_hist[i],
-                          percent(IOStats.Wais.read_hist[i], IOStats.Wais.reads));
-    }
 }
 
 static const char *
index 56cf96cff9f924a0132aecf4778ee4588b6c3af1..07bd1f3e0d71b6a90d47d237ba86a932468ce913 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: structs.h,v 1.550 2006/11/01 19:22:10 serassio Exp $
+ * $Id: structs.h,v 1.551 2007/02/25 11:32:33 hno Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -203,15 +203,6 @@ struct _SquidConfig
     Swap;
     size_t memMaxSize;
 
-    struct
-    {
-        char *relayHost;
-        u_short relayPort;
-        peer *_peer;
-    }
-
-    Wais;
-
     struct
     {
         size_t min;
@@ -1234,7 +1225,7 @@ struct _iostats
         int write_hist[16];
     }
 
-    Http, Ftp, Gopher, Wais;
+    Http, Ftp, Gopher;
 };
 
 
diff --git a/src/wais.cc b/src/wais.cc
deleted file mode 100644 (file)
index e9557ef..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-
-/*
- * $Id: wais.cc,v 1.163 2006/09/19 07:56:57 adrian Exp $
- *
- * DEBUG: section 24    WAIS Relay
- * AUTHOR: Harvest Derived
- *
- * SQUID Web Proxy Cache          http://www.squid-cache.org/
- * ----------------------------------------------------------
- *
- *  Squid is the result of efforts by numerous individuals from
- *  the Internet community; see the CONTRIBUTORS file for full
- *  details.   Many organizations have provided support for Squid's
- *  development; see the SPONSORS file for full details.  Squid is
- *  Copyrighted (C) 2001 by the Regents of the University of
- *  California; see the COPYRIGHT file for full details.  Squid
- *  incorporates software developed and/or copyrighted by other
- *  sources; see the CREDITS file for full details.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *  
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *  
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
- *
- */
-
-#include "squid.h"
-#include "errorpage.h"
-#include "Store.h"
-#include "HttpRequest.h"
-#if DELAY_POOLS
-#include "DelayPools.h"
-#include "MemObject.h"
-#endif
-#include "comm.h"
-#include "MemBuf.h"
-#include "forward.h"
-#include "SquidTime.h"
-
-class WaisStateData
-{
-
-public:
-    int fd;
-    StoreEntry *entry;
-    method_t method;
-    const HttpHeader *request_hdr;
-    char url[MAX_URL];
-    HttpRequest *request;
-    FwdState::Pointer fwd;
-    char buf[BUFSIZ];
-    bool dataWritten;
-};
-
-static PF waisStateFree;
-static PF waisTimeout;
-static IOCB waisReadReply;
-static IOCB waisSendComplete;
-static PF waisSendRequest;
-
-static void
-waisStateFree(int fdnotused, void *data)
-{
-    WaisStateData *waisState = (WaisStateData *)data;
-
-    if (waisState == NULL)
-        return;
-
-    waisState->entry->unlock();
-
-    HTTPMSGUNLOCK(waisState->request);
-
-    waisState->fwd = NULL;     // refcounted
-
-    cbdataFree(waisState);
-}
-
-/* This will be called when socket lifetime is expired. */
-static void
-waisTimeout(int fd, void *data)
-{
-    WaisStateData *waisState = (WaisStateData *)data;
-    StoreEntry *entry = waisState->entry;
-    debug(24, 4) ("waisTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
-
-    if (entry->store_status == STORE_PENDING) {
-        waisState->fwd->fail(errorCon(ERR_READ_TIMEOUT, HTTP_GATEWAY_TIMEOUT, waisState->fwd->request));
-    }
-
-    comm_close(fd);
-}
-
-/* This will be called when data is ready to be read from fd.  Read until
- * error or connection closed. */
-static void
-waisReadReply(int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void *data)
-{
-    WaisStateData *waisState = (WaisStateData *)data;
-    StoreEntry *entry = waisState->entry;
-    int clen;
-    int bin;
-    size_t read_sz;
-#if DELAY_POOLS
-
-    DelayId delayId = entry->mem_obj->mostBytesAllowed();
-#endif
-
-    /* Bail out early on COMM_ERR_CLOSING - close handlers will tidy up for us */
-
-    if (flag == COMM_ERR_CLOSING) {
-        return;
-    }
-
-    if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
-        comm_close(fd);
-        return;
-    }
-
-    errno = 0;
-    read_sz = BUFSIZ;
-
-    if (flag == COMM_OK && len > 0) {
-#if DELAY_POOLS
-        delayId.bytesIn(len);
-#endif
-
-        kb_incr(&statCounter.server.all.kbytes_in, len);
-        kb_incr(&statCounter.server.other.kbytes_in, len);
-    }
-
-#if DELAY_POOLS
-    read_sz = delayId.bytesWanted(1, read_sz);
-
-#endif
-
-    debug(24, 5) ("waisReadReply: FD %d read len:%d\n", fd, (int)len);
-
-    if (flag == COMM_OK && len > 0) {
-        commSetTimeout(fd, Config.Timeout.read, NULL, NULL);
-        IOStats.Wais.reads++;
-
-        for (clen = len - 1, bin = 0; clen; bin++)
-            clen >>= 1;
-
-        IOStats.Wais.read_hist[bin]++;
-    }
-
-    if (flag != COMM_OK || len < 0) {
-        debug(50, 1) ("waisReadReply: FD %d: read failure: %s.\n",
-                      fd, xstrerror());
-
-        if (ignoreErrno(xerrno)) {
-            /* reinstall handlers */
-            /* XXX This may loop forever */
-            comm_read(fd, waisState->buf, read_sz, waisReadReply, waisState);
-        } else {
-            ErrorState *err;
-            err = errorCon(ERR_READ_ERROR, HTTP_INTERNAL_SERVER_ERROR, waisState->fwd->request);
-            err->xerrno = errno;
-            waisState->fwd->fail(err);
-            comm_close(fd);
-        }
-    } else if (flag == COMM_OK && len == 0 && !waisState->dataWritten) {
-        waisState->fwd->fail(errorCon(ERR_ZERO_SIZE_OBJECT, HTTP_SERVICE_UNAVAILABLE, waisState->fwd->request));
-        comm_close(fd);
-    } else if (flag == COMM_OK && len == 0) {
-        /* Connection closed; retrieval done. */
-        entry->expires = squid_curtime;
-        waisState->fwd->complete();
-        comm_close(fd);
-    } else {
-        waisState->dataWritten = 1;
-        storeAppend(entry, buf, len);
-        comm_read(fd, waisState->buf, read_sz, waisReadReply, waisState);
-    }
-}
-
-/* This will be called when request write is complete. Schedule read of
- * reply. */
-static void
-waisSendComplete(int fd, char *bufnotused, size_t size, comm_err_t errflag, int xerrno, void *data)
-{
-    WaisStateData *waisState = (WaisStateData *)data;
-    StoreEntry *entry = waisState->entry;
-    debug(24, 5) ("waisSendComplete: FD %d size: %d errflag: %d\n",
-                  fd, (int) size, errflag);
-
-    if (size > 0) {
-        fd_bytes(fd, size, FD_WRITE);
-        kb_incr(&statCounter.server.all.kbytes_out, size);
-        kb_incr(&statCounter.server.other.kbytes_out, size);
-    }
-
-    if (errflag == COMM_ERR_CLOSING)
-        return;
-
-    if (errflag) {
-        ErrorState *err;
-        err = errorCon(ERR_WRITE_ERROR, HTTP_SERVICE_UNAVAILABLE, waisState->fwd->request);
-        err->xerrno = xerrno;
-        waisState->fwd->fail(err);
-        comm_close(fd);
-    } else {
-        /* Schedule read reply. */
-        entry->delayAwareRead(fd, waisState->buf, BUFSIZ, waisReadReply, waisState);
-    }
-}
-
-/* This will be called when connect completes. Write request. */
-static void
-waisSendRequest(int fd, void *data)
-{
-    WaisStateData *waisState = (WaisStateData *)data;
-    MemBuf mb;
-    const char *Method = RequestMethodStr[waisState->method];
-    debug(24, 5) ("waisSendRequest: FD %d\n", fd);
-    mb.init();
-    mb.Printf("%s %s HTTP/1.0\r\n", Method, waisState->url);
-
-    if (waisState->request_hdr) {
-        Packer p;
-        packerToMemInit(&p, &mb);
-        waisState->request_hdr->packInto(&p);
-        packerClean(&p);
-    }
-
-    mb.Printf("\r\n");
-    debug(24, 6) ("waisSendRequest: buf: %s\n", mb.buf);
-    comm_write_mbuf(fd, &mb, waisSendComplete, waisState);
-
-    if (EBIT_TEST(waisState->entry->flags, ENTRY_CACHABLE))
-        storeSetPublicKey(waisState->entry);   /* Make it public */
-
-    EBIT_CLR(waisState->entry->flags, ENTRY_FWD_HDR_WAIT);
-}
-
-CBDATA_TYPE(WaisStateData);
-void
-waisStart(FwdState * fwd)
-{
-    WaisStateData *waisState = NULL;
-    HttpRequest *request = fwd->request;
-    StoreEntry *entry = fwd->entry;
-    int fd = fwd->server_fd;
-    const char *url = storeUrl(entry);
-    method_t method = request->method;
-    debug(24, 3) ("waisStart: \"%s %s\"\n", RequestMethodStr[method], url);
-    statCounter.server.all.requests++;
-    statCounter.server.other.requests++;
-    CBDATA_INIT_TYPE(WaisStateData);
-    waisState = cbdataAlloc(WaisStateData);
-    waisState->method = method;
-    waisState->request_hdr = &request->header;
-    waisState->fd = fd;
-    waisState->entry = entry;
-    waisState->dataWritten = 0;
-    xstrncpy(waisState->url, url, MAX_URL);
-    waisState->request = HTTPMSGLOCK(request);
-    waisState->fwd = fwd;
-    comm_add_close_handler(waisState->fd, waisStateFree, waisState);
-
-    entry->lock()
-
-    ;
-    commSetTimeout(fd, Config.Timeout.read, waisTimeout, waisState);
-
-    waisSendRequest(fd, waisState);
-}