From: wessels <> Date: Wed, 30 Sep 1998 08:53:17 +0000 (+0000) Subject: Added offline mode X-Git-Tag: SQUID_3_0_PRE1~2618 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b540e168216e37df381c0b851509593375d3e984;p=thirdparty%2Fsquid.git Added offline mode --- diff --git a/src/access_log.cc b/src/access_log.cc index 3f67e234d1..075c441c98 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -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", diff --git a/src/cf.data.pre b/src/cf.data.pre index a11683e5ed..8ba71f6691 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -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 diff --git a/src/client_side.cc b/src/client_side.cc index a6077b95cc..6871e3a920 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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; diff --git a/src/enums.h b/src/enums.h index f177c514ca..5b9bb44eae 100644 --- a/src/enums.h +++ b/src/enums.h @@ -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, diff --git a/src/structs.h b/src/structs.h index d4a799e296..6b2a4334c3 100644 --- a/src/structs.h +++ b/src/structs.h @@ -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 {