/*
- * $Id: cache_cf.cc,v 1.327 1999/04/23 02:57:18 wessels Exp $
+ * $Id: cache_cf.cc,v 1.328 1999/05/04 20:49:36 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
#endif
} else if (!strncasecmp(token, "login=", 6)) {
p->login = xstrdup(token + 6);
+ } else if (!strncasecmp(token, "connect-timeout=", 16)) {
+ p->connect_timeout = atoi(token + 16);
} else {
debug(3, 0) ("parse_peer: token='%s'\n", token);
self_destruct();
#
-# $Id: cf.data.pre,v 1.150 1999/04/30 18:06:34 wessels Exp $
+# $Id: cf.data.pre,v 1.151 1999/05/04 20:49:37 wessels Exp $
#
#
# SQUID Internet Object Cache http://squid.nlanr.net/Squid/
no-netdb-exchange
no-delay
login=user:password
+ connect-timeout=nn
use 'proxy-only' to specify that objects fetched
from this cache should not be saved locally.
use 'login=user:password' if this is a personal/workgroup
proxy and your parent requires proxy authentication.
+ use 'connect-timeout=nn' to specify a peer
+ specific connect timeout (also see the
+ peer_connect_timeout directive)
+
+
NOTE: non-ICP neighbors must be specified as 'parent'.
cache_peer hostname type 3128 3130
match, then the default will be used.
Default:
+NOCOMMENT_START
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
+NOCOMMENT_END
DOC_END
connect_timeout 120 seconds
DOC_END
+NAME: peer_connect_timeout
+COMMENT: time-units
+TYPE: time_t
+LOC: Config.Timeout.peer_connect
+DEFAULT: 30 seconds
+DOC_START
+ This parameter specifies how long to wait for a pending TCP
+ connection to a peer cache. The default is 30 seconds. You
+ may also set different timeout values for individual neighbors
+ with the 'connect-timeout' option on a 'cache_peer' line.
+peer_connect_timeout 30 seconds
+
NAME: siteselect_timeout
COMMENT: time-units
TYPE: time_t
/*
- * $Id: forward.cc,v 1.57 1999/04/23 02:57:22 wessels Exp $
+ * $Id: forward.cc,v 1.58 1999/05/04 20:49:38 wessels Exp $
*
* DEBUG: section 17 Request Forwarding
* AUTHOR: Duane Wessels
err->request = requestLink(fwdState->request);
err->xerrno = ETIMEDOUT;
fwdFail(fwdState, err);
+ if (fwdState->servers->peer)
+ peerConnectFailed(fwdState->servers->peer);
}
comm_close(fd);
}
FwdServer *fs = fwdState->servers;
const char *host;
unsigned short port;
+ time_t ctimeout;
assert(fs);
assert(fwdState->server_fd == -1);
debug(17, 3) ("fwdConnectStart: %s\n", url);
if (fs->peer) {
host = fs->peer->host;
port = fs->peer->http_port;
+ ctimeout = fs->peer->connect_timeout > 0 ? fs->peer->connect_timeout
+ : Config.Timeout.peer_connect;
} else {
host = fwdState->request->host;
port = fwdState->request->port;
+ ctimeout = Config.Timeout.connect;
}
hierarchyNote(&fwdState->request->hier, fs->code, host);
if ((fd = pconnPop(host, port)) >= 0) {
fwdState->n_tries++;
comm_add_close_handler(fd, fwdServerClosed, fwdState);
commSetTimeout(fd,
- Config.Timeout.connect,
+ ctimeout,
fwdConnectTimeout,
fwdState);
commConnectStart(fd, host, port, fwdConnectDone, fwdState);
/*
- * $Id: structs.h,v 1.287 1999/05/03 21:55:14 wessels Exp $
+ * $Id: structs.h,v 1.288 1999/05/04 20:49:39 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
time_t read;
time_t lifetime;
time_t connect;
+ time_t peer_connect;
time_t request;
time_t pconn;
time_t siteSelect;
} carp;
#endif
char *login; /* Proxy authorization */
+ time_t connect_timeout;
};
struct _net_db_name {