From 7e820f36eb2b2133a06a6fd3ccf8c18c2befe174 Mon Sep 17 00:00:00 2001 From: hno <> Date: Fri, 21 Jun 2002 18:58:20 +0000 Subject: [PATCH] read_ahead_gap config directive by Jeffrey D. Wheelhouse. Allows the read-ahead gap to be configured from squid.conf (previously hardcoded at 16 KB) --- src/cf.data.pre | 11 ++++++++++- src/defines.h | 4 +--- src/forward.cc | 4 ++-- src/structs.h | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/cf.data.pre b/src/cf.data.pre index f326c042e1..34ff795738 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.262 2002/06/18 10:54:17 hno Exp $ +# $Id: cf.data.pre,v 1.263 2002/06/21 12:58:20 hno Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1639,6 +1639,15 @@ DOC_START cached then set 'quick_abort_min' to '-1 KB'. DOC_END +NAME: read_ahead_gap +COMMENT: buffer-size +TYPE: kb_size_t +LOC: Config.readAheadGap +DEFAULT: 16 KB +DOC_START + The amount of data the cache will buffer ahead of what has been + sent to the client when retrieving an object from another server. +DOC_END NAME: negative_ttl COMMENT: time-units diff --git a/src/defines.h b/src/defines.h index aa55f54e37..64c80bf73e 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.103 2002/06/04 15:04:05 hno Exp $ + * $Id: defines.h,v 1.104 2002/06/21 12:58:20 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -178,8 +178,6 @@ #define ERROR_BUF_SZ (MAX_URL << 2) #endif -#define READ_AHEAD_GAP (1<<14) - #if SQUID_SNMP #define VIEWINCLUDED 1 #define VIEWEXCLUDED 2 diff --git a/src/forward.cc b/src/forward.cc index 43e7a67485..2dfff334c3 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.84 2002/04/13 23:07:50 hno Exp $ + * $Id: forward.cc,v 1.85 2002/06/21 12:58:20 hno Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -644,7 +644,7 @@ fwdCheckDeferRead(int fd, void *data) #endif if (EBIT_TEST(e->flags, ENTRY_FWD_HDR_WAIT)) return rc; - if (mem->inmem_hi - storeLowestMemReaderOffset(e) < READ_AHEAD_GAP) + if (mem->inmem_hi - storeLowestMemReaderOffset(e) < Config.readAheadGap) return rc; return 1; } diff --git a/src/structs.h b/src/structs.h index 3580d72909..ff4638a3dd 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.419 2002/06/18 22:52:32 hno Exp $ + * $Id: structs.h,v 1.420 2002/06/21 12:58:20 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -384,6 +384,7 @@ struct _SquidConfig { int pct; size_t max; } quickAbort; + size_t readAheadGap; RemovalPolicySettings *replPolicy; RemovalPolicySettings *memPolicy; time_t referenceAge; -- 2.47.3