]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added offline mode
authorwessels <>
Wed, 30 Sep 1998 08:53:17 +0000 (08:53 +0000)
committerwessels <>
Wed, 30 Sep 1998 08:53:17 +0000 (08:53 +0000)
src/access_log.cc
src/cf.data.pre
src/client_side.cc
src/enums.h
src/structs.h

index 3f67e234d10dffe5f10ef253da9e9805ffe29acc..075c441c98bb30caaa4154b25373d6fd68795896 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: access_log.cc,v 1.42 1998/08/27 06:28:54 wessels Exp $
+ * $Id: access_log.cc,v 1.43 1998/09/30 02:53:17 wessels Exp $
  *
  * DEBUG: section 46    Access Log
  * AUTHOR: Duane Wessels
@@ -56,6 +56,7 @@ const char *log_tags[] =
     "TCP_NEGATIVE_HIT",
     "TCP_MEM_HIT",
     "TCP_DENIED",
+    "TCP_OFFLINE_HIT",
     "UDP_HIT",
     "UDP_MISS",
     "UDP_DENIED",
index a11683e5ed3a56fde680256169f06dba2716cbfd..8ba71f669194510b57014dbc94998cf19c7e70db 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# $Id: cf.data.pre,v 1.115 1998/09/23 21:21:05 wessels Exp $
+# $Id: cf.data.pre,v 1.116 1998/09/30 02:53:20 wessels Exp $
 #
 #
 # SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -2617,4 +2617,13 @@ LOC: Config.max_open_disk_fds
 DEFAULT: 0
 DOC_NONE
 
+NAME: offline_mode
+TYPE: onoff
+LOC: Config.onoff.offline
+DEFAULT: off
+DOC_START
+       Enable this option and Squid will never try to validate cached
+       objects.
+DOC_END
+
 EOF
index a6077b95cc466b5257882f2cb99e0f1ec0ab9748..6871e3a920c38c9cc665b263ba191fbbf022b012 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.404 1998/09/29 23:53:27 rousskov Exp $
+ * $Id: client_side.cc,v 1.405 1998/09/30 02:53:18 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -532,6 +532,7 @@ clientUpdateCounters(clientHttpRequest * http)
        break;
     case LOG_TCP_HIT:
     case LOG_TCP_MEM_HIT:
+    case LOG_TCP_OFFLINE_HIT:
        statHistCount(&Counter.client_http.hit_svc_time, svc_time);
        break;
     case LOG_TCP_MISS:
@@ -864,6 +865,8 @@ isTcpHit(log_type code)
        return 1;
     if (code == LOG_TCP_MEM_HIT)
        return 1;
+    if (code == LOG_TCP_OFFLINE_HIT)
+       return 1;
     return 0;
 }
 
@@ -1215,6 +1218,8 @@ clientCacheHit(void *data, char *buf, ssize_t size)
         */
        if (e->mem_status == IN_MEMORY)
            http->log_type = LOG_TCP_MEM_HIT;
+       else if (Config.onoff.offline)
+           http->log_type = LOG_TCP_OFFLINE_HIT;
        clientSendMoreData(data, buf, size);
     }
 }
@@ -1604,6 +1609,9 @@ clientProcessRequest2(clientHttpRequest * http)
     if (NULL == e) {
        /* this object isn't in the cache */
        return LOG_TCP_MISS;
+    } else if (Config.onoff.offline) {
+       http->entry = e;
+       return LOG_TCP_HIT;
     } else if (!storeEntryValidToSend(e)) {
        http->entry = NULL;
        return LOG_TCP_MISS;
index f177c514caad6bbee01a752f4315c6b8634bbce1..5b9bb44eaef69fd304a856c89d9ccd1d0f77228b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: enums.h,v 1.133 1998/09/29 16:33:45 wessels Exp $
+ * $Id: enums.h,v 1.134 1998/09/30 02:53:19 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -44,6 +44,7 @@ typedef enum {
     LOG_TCP_NEGATIVE_HIT,
     LOG_TCP_MEM_HIT,
     LOG_TCP_DENIED,
+    LOG_TCP_OFFLINE_HIT,
     LOG_UDP_HIT,
     LOG_UDP_MISS,
     LOG_UDP_DENIED,
index d4a799e29679e486ce5afb330499bc447ca391d3..6b2a4334c318a9be228c8b7da3ac4aa73513ba5a 100644 (file)
@@ -2,7 +2,7 @@
 
 
 /*
- * $Id: structs.h,v 1.236 1998/09/29 16:33:55 wessels Exp $
+ * $Id: structs.h,v 1.237 1998/09/30 02:53:19 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -377,6 +377,7 @@ struct _SquidConfig {
 #if HTTP_VIOLATIONS
        int reload_into_ims;
 #endif
+       int offline;
     } onoff;
     acl *aclList;
     struct {