/*
- * $Id: cache_cf.cc,v 1.285 1998/06/03 20:34:41 wessels Exp $
+ * $Id: cache_cf.cc,v 1.286 1998/06/08 17:29:14 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
if (Config.Port.http == NULL)
fatal("No http_port specified!");
snprintf(ThisCache, sizeof(ThisCache), "%s:%d (%s)",
- getMyHostname(),
+ uniqueHostname(),
(int) Config.Port.http->i,
full_appname_string);
if (!Config.udpMaxHitObjsz || Config.udpMaxHitObjsz > SQUID_UDP_SO_SNDBUF)
if (p->weight < 1)
p->weight = 1;
p->icp_version = ICP_VERSION_CURRENT;
- p->tcp_up = 1;
+ p->tcp_up = PEER_TCP_MAGIC_COUNT;
cbdataAdd(p, MEM_NONE);
while (*head != NULL)
head = &(*head)->next;
visible_hostname www-cache.foo.org
DOC_END
+
+NAME: unique_hostname
+TYPE: string
+LOC: Config.uniqueHostname
+DEFAULT: none
+DOC_START
+ If you want to have multiple machines with the same
+ 'visible_hostname' then you must give each machine a different
+ 'unique_hostname' so that forwarding loops can be detected.
+
+unique_hostname www-cache1.foo.org
+DOC_END
+
COMMENT_START
OPTIONS FOR THE CACHE REGISTRATION SERVICE
-----------------------------------------------------------------------------
/*
- * $Id: client_db.cc,v 1.34 1998/05/30 19:43:04 rousskov Exp $
+ * $Id: client_db.cc,v 1.35 1998/06/08 17:29:16 wessels Exp $
*
* DEBUG: section 0 Client Database
* AUTHOR: Duane Wessels
c->key = xstrdup(inet_ntoa(addr));
c->addr = addr;
hash_join(client_table, (hash_link *) c);
+ Counter.client_http.clients++;
return c;
}
*/
#define INCOMING_HTTP_MAX 10
#define INCOMING_TOTAL_MAX (INCOMING_ICP_MAX+INCOMING_HTTP_MAX)
+
+/*
+ * This many TCP connections must FAIL before we mark the
+ * peer as DEAD
+ */
+#define PEER_TCP_MAGIC_COUNT 10
/*
- * $Id: neighbors.cc,v 1.221 1998/06/05 17:34:19 wessels Exp $
+ * $Id: neighbors.cc,v 1.222 1998/06/08 17:29:17 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
else if (*exprep > 0)
(*timeout) = 2 * (*timeout) / (*exprep);
else
- *timeout = 2000; /* 2 seconds */
+ *timeout = 2000; /* 2 seconds */
return peers_pinged;
}
peerCheckConnectDone(int fd, int status, void *data)
{
peer *p = data;
- p->tcp_up = status == COMM_OK ? 1 : 0;
- if (p->tcp_up) {
+ if (status == COMM_OK) {
+ p->tcp_up = PEER_TCP_MAGIC_COUNT;
debug(15, 0) ("TCP connection to %s/%d succeeded\n",
p->host, p->http_port);
} else {
- eventAdd("peerCheckConnect", peerCheckConnect, p, 80.0, 1);
+ eventAdd("peerCheckConnect", peerCheckConnect, p, 60.0, 1);
}
comm_close(fd);
return;
if (!p->tcp_up)
return;
debug(15, 0) ("TCP connection to %s/%d failed\n", p->host, p->http_port);
- p->tcp_up = 0;
+ p->tcp_up--;
+ if (p->tcp_up != (PEER_TCP_MAGIC_COUNT - 1))
+ return;
p->last_fail_time = squid_curtime;
- eventAdd("peerCheckConnect", peerCheckConnect, p, 80.0, 1);
+ eventAdd("peerCheckConnect", peerCheckConnect, p, 30.0, 1);
}
static void
extern const char *getMyHostname(void);
+extern const char *uniqueHostname(void);
extern void safeunlink(const char *path, int quiet);
extern void death(int sig);
extern void fatal(const char *message);
/*
- * $Id: stat.cc,v 1.257 1998/05/28 23:35:33 wessels Exp $
+ * $Id: stat.cc,v 1.258 1998/06/08 17:29:19 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
mkrfc1123(current_time.tv_sec));
storeAppendPrintf(sentry, "Connection information for %s:\n",
appname);
+ storeAppendPrintf(sentry, "\tNumber of clients accessing cache:\t%u\n",
+ Counter.client_http.clients);
storeAppendPrintf(sentry, "\tNumber of HTTP requests received:\t%u\n",
Counter.client_http.requests);
storeAppendPrintf(sentry, "\tNumber of ICP messages received:\t%u\n",
time_t pconn;
time_t siteSelect;
time_t deadPeer;
- int icp_query; /* msec */
- int mcast_icp_query; /* msec */
+ int icp_query; /* msec */
+ int mcast_icp_query; /* msec */
} Timeout;
size_t maxRequestSize;
struct {
char *pidFilename;
char *mimeTablePathname;
char *visibleHostname;
+ char *uniqueHostname;
char *errHtmlText;
struct {
char *host;
* Note: "str" points to memory in HttpHeaderEntry (for now)
* so ETags should be used as tmp variables only (for now) */
struct _ETag {
- const char *str; /* quoted-string */
- int weak; /* true if it is a weak validator */
+ const char *str; /* quoted-string */
+ int weak; /* true if it is a weak validator */
};
struct _fde {
/* some fields can hold either time or etag specs (e.g. If-Range) */
struct _TimeOrTag {
- ETag tag; /* entity tag */
+ ETag tag; /* entity tag */
time_t time;
- int valid; /* true if struct is usable */
+ int valid; /* true if struct is usable */
};
/* data for iterating thru range specs */
-struct _HttpHdrRangeIter {
+struct _HttpHdrRangeIter {
HttpHdrRangePos pos;
- const HttpHdrRangeSpec *spec; /* current spec at pos */
- size_t debt_size; /* bytes left to send from the current spec */
- size_t prefix_size; /* the size of the incoming HTTP msg prefix */
- String boundary; /* boundary for multipart responses */
+ const HttpHdrRangeSpec *spec; /* current spec at pos */
+ size_t debt_size; /* bytes left to send from the current spec */
+ size_t prefix_size; /* the size of the incoming HTTP msg prefix */
+ String boundary; /* boundary for multipart responses */
};
/* constant attributes of http header fields */
int n_sent;
int n_recv;
int n_replies_expected;
- int timeout; /* msec */
+ int timeout; /* msec */
int timedout;
int w_rtt;
int p_rtt;
off_t offset;
size_t size;
} out;
- HttpHdrRangeIter range_iter;/* data for iterating thru range specs */
- size_t req_sz; /* raw request size on input, not current request size */
+ HttpHdrRangeIter range_iter; /* data for iterating thru range specs */
+ size_t req_sz; /* raw request size on input, not current request size */
StoreEntry *entry;
StoreEntry *old_entry;
log_type log_type;
*/
struct _StatCounters {
struct {
+ int clients;
int requests;
int hits;
int errors;
/*
- * $Id: tools.cc,v 1.157 1998/06/03 20:48:21 rousskov Exp $
+ * $Id: tools.cc,v 1.158 1998/06/08 17:29:21 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
return host;
}
+const char *
+uniqueHostname(void)
+{
+ return Config.uniqueHostname ? Config.uniqueHostname : getMyHostname();
+}
+
void
safeunlink(const char *s, int quiet)
{