]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
added ipcacheInvalidate() and -i option
authorwessels <>
Tue, 27 Aug 1996 01:16:05 +0000 (01:16 +0000)
committerwessels <>
Tue, 27 Aug 1996 01:16:05 +0000 (01:16 +0000)
src/ftp.cc
src/gopher.cc
src/http.cc
src/ipcache.cc
src/ssl.cc
src/tunnel.cc
src/wais.cc

index 09f259faf232eb0315d5c589437a7d2fb736a6ca..4f23b075d0a80b050cbfe196c65556a28cd95af6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.49 1996/07/26 17:18:21 wessels Exp $
+ * $Id: ftp.cc,v 1.50 1996/08/26 19:16:05 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -565,6 +565,8 @@ void ftpConnInProgress(fd, data)
        COMM_SELECT_WRITE,
        (PF) ftpSendRequest,
        (void *) data);
+    if (opt_no_ipcache)
+       ipcacheInvalidate(data->request->host);
 }
 
 
@@ -670,6 +672,8 @@ int ftpStart(unusedfd, url, request, entry)
        COMM_SELECT_LIFETIME,
        (PF) ftpLifetimeExpire,
        (void *) data);
+    if (opt_no_ipcache)
+       ipcacheInvalidate(data->request->host);
     return COMM_OK;
 }
 
index 92e10348cd1ee2cda9a3ed680c5b0eca7bf1a31c..1ceb783395a8667b32e4ba5296047c510e4516be 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: gopher.cc,v 1.38 1996/07/26 17:18:23 wessels Exp $
+ * $Id: gopher.cc,v 1.39 1996/08/26 19:16:05 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -1000,6 +1000,8 @@ int gopherStart(unusedfd, url, entry)
        }
     }
     /* Install connection complete handler. */
+    if (opt_no_ipcache)
+       ipcacheInvalidate(data->host);
     comm_set_select_handler(sock,
        COMM_SELECT_LIFETIME,
        (PF) gopherLifetimeExpire,
index f584d37c5bb744a98ac742dfadb29b00e97e43d9..37fd6ddf70a733d0edac70c93a4c82929c7745a4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.67 1996/07/26 17:18:23 wessels Exp $
+ * $Id: http.cc,v 1.68 1996/08/26 19:16:06 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -656,6 +656,8 @@ static void httpConnInProgress(fd, httpState)
        }
     }
     /* Call the real write handler, now that we're fully connected */
+    if (opt_no_ipcache)
+       ipcacheInvalidate(entry->mem_obj->request->host);
     comm_set_select_handler(fd, COMM_SELECT_WRITE,
        (PF) httpSendRequest, (void *) httpState);
 }
@@ -746,6 +748,8 @@ static int httpConnect(fd, hp, data)
        }
     }
     /* Install connection complete handler. */
+    if (opt_no_ipcache)
+       ipcacheInvalidate(request->host);
     fd_note(fd, entry->url);
     comm_set_select_handler(fd, COMM_SELECT_LIFETIME,
        (PF) httpLifetimeExpire, (void *) httpState);
index 2b8738d04450c0467ea9c7d9fad80c0cfceb69a0..41808539768b498b7609ae9e949c5a3e2512dfef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ipcache.cc,v 1.40 1996/08/21 05:50:08 wessels Exp $
+ * $Id: ipcache.cc,v 1.41 1996/08/26 19:16:07 wessels Exp $
  *
  * DEBUG: section 14    IP Cache
  * AUTHOR: Harvest Derived
@@ -1109,3 +1109,15 @@ void ipcacheReleaseInvalid(name)
        return;
     ipcache_release(i);
 }
+
+void ipcacheInvalidate(name)
+     char *name;
+{
+    ipcache_entry *i;
+    if ((i = ipcache_get(name)) == NULL)
+       return;
+    if (i->status != IP_CACHED)
+       i->ttl = 0;
+    else
+        ipcache_release(i);
+}
index fa9c6b058db94a9eaefe548edccf44f9040b6528..803ef5f528345a2e849423436cb4cfb692a863ce 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.10 1996/07/26 19:28:51 wessels Exp $
+ * $Id: ssl.cc,v 1.11 1996/08/26 19:16:08 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -346,6 +346,8 @@ static void sslConnInProgress(fd, sslState)
            return;
        }
     }
+    if (opt_no_ipcache)
+       ipcacheInvalidate(sslState->host);
     /* We are now fully connected */
     if (Config.sslProxy.host)
        sslProxyConnected(fd, sslState);
@@ -421,6 +423,8 @@ static int sslConnect(fd, hp, sslState)
                (void *) sslState);
            return COMM_OK;
        }
+       if (opt_no_ipcache)
+           ipcacheInvalidate(sslState->host);
     }
     if (Config.sslProxy.host)
        sslProxyConnected(sslState->server.fd, sslState);
index 8a6c6ad357abe7597d6d4d678018b7e6aca63922..d5e64d6c2faaf4d14cf1550329c70f9dffc87b49 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.10 1996/07/26 19:28:51 wessels Exp $
+ * $Id: tunnel.cc,v 1.11 1996/08/26 19:16:08 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -346,6 +346,8 @@ static void sslConnInProgress(fd, sslState)
            return;
        }
     }
+    if (opt_no_ipcache)
+       ipcacheInvalidate(sslState->host);
     /* We are now fully connected */
     if (Config.sslProxy.host)
        sslProxyConnected(fd, sslState);
@@ -421,6 +423,8 @@ static int sslConnect(fd, hp, sslState)
                (void *) sslState);
            return COMM_OK;
        }
+       if (opt_no_ipcache)
+           ipcacheInvalidate(sslState->host);
     }
     if (Config.sslProxy.host)
        sslProxyConnected(sslState->server.fd, sslState);
index 7f9de55c4df85b62fe49b3235644221d7c9efeee..eb3b5e3c90eec0c309ed301bd5e56f145eaecf0b 100644 (file)
@@ -1,5 +1,6 @@
+
 /*
- * $Id: wais.cc,v 1.35 1996/07/25 07:10:45 wessels Exp $
+ * $Id: wais.cc,v 1.36 1996/08/26 19:16:08 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -360,6 +361,8 @@ static void waisConnInProgress(fd, waisState)
        }
     }
     /* Call the real write handler, now that we're fully connected */
+    if (opt_no_ipcache)
+       ipcacheInvalidate(waisState->relayhost);
     comm_set_select_handler(fd, COMM_SELECT_WRITE,
        (PF) waisSendRequest, (void *) waisState);
 }
@@ -440,6 +443,8 @@ static int waisConnect(fd, hp, waisState)
        }
     }
     /* Install connection complete handler. */
+    if (opt_no_ipcache)
+       ipcacheInvalidate(host);
     comm_set_select_handler(fd,
        COMM_SELECT_LIFETIME,
        (PF) waisLifetimeExpire,