it overrides the automatic value.
- added reload_into_ims hacks from 1.1
neighbor_type_domain cache.foo.org sibling .au .de
DOC_END
-NAME: neighbor_timeout neighbour_timeout
-COMMENT: (seconds)
-DEFAULT: 2 seconds
-TYPE: time_t
-LOC: Config.neighborTimeout
+NAME: icp_query_timeout
+COMMENT: (msec)
+DEFAULT: 0
+TYPE: int
+LOC: Config.Timeout.icp_query
DOC_START
- This controls how long to wait for replies from neighbor caches.
- If none of the parent or neighbor caches reply before this many
- seconds (due to dropped packets or slow links), then the object
- request will be satisfied from the default source. The default
- timeout is two seconds.
+ Normally Squid will automatically determine an optimal ICP
+ query timeout value based on the round-trip-time of recent ICP
+ queries. If you want to override the value determined by
+ Squid, set this 'icp_query_timeout' to a non-zero value. This
+ value is specified in MILLISECONDS, so, to use a 2-second
+ timeout (the old default), you would write:
-neighbor_timeout 2 seconds
+ icp_query_timeout 2000
+
+icp_query_timeout 0
+DOC_END
+
+NAME: mcast_icp_query_timeout
+COMMENT: (msec)
+DEFAULT: 2000
+TYPE: int
+LOC: Config.Timeout.mcast_icp_query
+DOC_START
+ For Multicast peers, Squid regularly sends out ICP "probes" to
+ count how many other peers are listening on the given multicast
+ address. This value specifies how long Squid should wait to
+ count all the replies. The default is 2000 msec, or 2
+ seconds.
+
+mcast_icp_query_timeout 2000
DOC_END
NAME: dead_peer_timeout
buffered_logs off
DOC_END
+NAME: reload_into_ims
+COMMENT: on|off
+TYPE: onoff
+DEFAULT: off
+LOC: Config.onoff.reload_into_ims
+DOC_START
+ When you enable this option, client no-cache or ``reload''
+ requests will be changed to If-Modified-Since requests.
+ Doing this VIOLATES the HTTP standard. Enabling this
+ feature could make you liable for problems which it
+ causes.
+reload_into_ims off
+DOC_END
+
NAME: always_direct
TYPE: acl_access
LOC: Config.accessList.AlwaysDirect
/*
- * $Id: client_side.cc,v 1.331 1998/06/04 20:25:04 rousskov Exp $
+ * $Id: client_side.cc,v 1.332 1998/06/05 17:34:16 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
#endif
if (httpHeaderHas(req_hdr, HDR_PRAGMA)) {
String s = httpHeaderGetList(req_hdr, HDR_PRAGMA);
- if (strListIsMember(&s, "no-cache", ','))
- EBIT_SET(request->flags, REQ_NOCACHE);
+ if (strListIsMember(&s, "no-cache", ',')) {
+ if (!Config.onoff.reload_into_ims)
+ EBIT_SET(request->flags, REQ_NOCACHE);
+ else
+ EBIT_SET(request->flags, REQ_NOCACHE_HACK);
+ }
stringClean(&s);
}
#if OLD_CODE
} else if (EBIT_TEST(r->flags, REQ_IMS)) {
/* User-initiated IMS request for something we think is valid */
return LOG_TCP_IMS_MISS;
+ } else if (EBIT_TEST(r->flags, REQ_NOCACHE_HACK)) {
+ if (r->protocol == PROTO_HTTP)
+ return LOG_TCP_REFRESH_MISS;
+ else
+ return LOG_TCP_MISS; /* XXX zoinks */
} else if (e->mem_status == IN_MEMORY) {
return LOG_TCP_MEM_HIT;
} else {
REQ_PROXYING,
REQ_REFRESH,
REQ_USED_PROXY_AUTH,
- REQ_REDIRECTED
+ REQ_REDIRECTED,
+ REQ_NOCACHE_HACK, /* for changing no-cache requests into IMS */
};
enum {
/*
- * $Id: neighbors.cc,v 1.220 1998/06/03 20:34:44 wessels Exp $
+ * $Id: neighbors.cc,v 1.221 1998/06/05 17:34:19 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
IRCB * callback,
void *callback_data,
int *exprep,
- double *exprtt)
+ int *timeout)
{
const char *url = storeUrl(entry);
MemObject *mem = entry->mem_obj;
mem->start_ping = current_time;
mem->icp_reply_callback = callback;
mem->ircb_data = callback_data;
- *exprtt = 0.0;
+ *timeout = 0.0;
for (i = 0, p = first_ping; i++ < Config.npeers; p = p->next) {
if (p == NULL)
p = Config.peers;
} else if (neighborUp(p)) {
/* its alive, expect a reply from it */
(*exprep)++;
- (*exprtt) += (double) p->stats.rtt;
+ (*timeout) += p->stats.rtt;
} else {
/* Neighbor is dead; ping it anyway, but don't expect a reply */
/* log it once at the threshold */
host);
}
}
-#endif
-#if LOG_ICP_NUMBERS
- request->hierarchy.n_sent = peers_pinged;
- request->hierarchy.n_expect = *exprep;
#endif
/*
- * Average out the expected RTT and then double it
+ * If there is a configured timeout, use it
*/
- if (*exprep > 0)
- (*exprtt) = 2.0 * (*exprtt) / (double) (*exprep);
+ if (Config.Timeout.icp_query)
+ *timeout = Config.Timeout.icp_query * 1000;
+ else if (*exprep > 0)
+ (*timeout) = 2 * (*timeout) / (*exprep);
else
- *exprtt = Config.neighborTimeout;
+ *timeout = 2000; /* 2 seconds */
return peers_pinged;
}
eventAdd("peerCountMcastPeersDone",
peerCountMcastPeersDone,
psstate,
- (double) Config.neighborTimeout, 1);
+ (double) Config.Timeout.mcast_icp_query, 1);
p->mcast.flags |= PEER_COUNTING;
peerCountMcastPeersSchedule(p, MCAST_COUNT_RATE);
}
/*
- * $Id: peer_select.cc,v 1.64 1998/05/28 20:47:54 wessels Exp $
+ * $Id: peer_select.cc,v 1.65 1998/06/05 17:34:19 wessels Exp $
*
* DEBUG: section 44 Peer Selection Algorithm
* AUTHOR: Duane Wessels
debug(44, 1) ("Failed to select source for '%s'\n", url);
debug(44, 1) (" always_direct = %d\n", psstate->always_direct);
debug(44, 1) (" never_direct = %d\n", psstate->never_direct);
- debug(44, 1) (" timeout = %d\n", psstate->icp.timeout);
+ debug(44, 1) (" timedout = %d\n", psstate->icp.timedout);
if (cbdataValid(data))
psstate->fail_callback(NULL, data);
cbdataUnlock(data);
StoreEntry *entry = psstate->entry;
request_t *request = psstate->request;
int direct;
- double expected_rtt;
debug(44, 3) ("peerSelectFoo: '%s %s'\n",
RequestMethodStr[request->method],
request->host);
peerHandleIcpReply,
psstate,
&psstate->icp.n_replies_expected,
- &expected_rtt);
+ &psstate->icp.timeout);
if (psstate->icp.n_sent == 0)
debug(44, 0) ("WARNING: neighborsUdpPing returned 0\n");
debug(44, 3) ("peerSelectFoo: %d ICP replies expected, RTT %f msec\n",
- psstate->icp.n_replies_expected, expected_rtt);
+ psstate->icp.n_replies_expected, psstate->icp.timeout);
if (psstate->icp.n_replies_expected > 0) {
entry->ping_status = PING_WAITING;
eventAdd("peerPingTimeout",
peerPingTimeout,
psstate,
- expected_rtt / 1000.0,
+ 0.001 * psstate->icp.timeout,
0);
return;
}
debug(44, 3) ("peerPingTimeout: '%s'\n", storeUrl(entry));
entry->ping_status = PING_TIMEOUT;
PeerStats.timeouts++;
- psstate->icp.timeout = 1;
+ psstate->icp.timedout = 1;
peerSelectFoo(psstate);
}
IRCB * callback,
void *data,
int *exprep,
- double *exprtt);
+ int *timeout);
extern void neighborAddAcl(const char *, const char *);
extern void neighborsUdpAck(const cache_key *, icp_common_t *, const struct sockaddr_in *);
extern void neighborAdd(const char *, const char *, int, int, int, int, int);
time_t negativeDnsTtl;
time_t positiveDnsTtl;
time_t shutdownLifetime;
- time_t neighborTimeout;
struct {
time_t read;
time_t lifetime;
time_t pconn;
time_t siteSelect;
time_t deadPeer;
+ int icp_query; /* msec */
+ int mcast_icp_query; /* msec */
} Timeout;
size_t maxRequestSize;
struct {
int mem_pools;
int test_reachability;
int half_closed_clients;
+ int reload_into_ims;
} onoff;
acl *aclList;
struct {
int n_sent;
int n_recv;
int n_replies_expected;
- int timeout;
+ int timeout; /* msec */
+ int timedout;
int w_rtt;
int p_rtt;
};