Index: squid/errors/English/ERR_CONNECT_FAIL
diff -c squid/errors/English/ERR_CONNECT_FAIL:1.4.6.3 squid/errors/English/ERR_CONNECT_FAIL:1.4.6.4
*** squid/errors/English/ERR_CONNECT_FAIL:1.4.6.3 Wed Aug 28 15:07:58 2002
--- squid/errors/English/ERR_CONNECT_FAIL Fri Mar 10 15:54:38 2006
***************
*** 14,20 ****
--- 14,20 ----
-
! Connection to %I Failed
Index: squid/src/errorpage.c
diff -c squid/src/errorpage.c:1.167.2.13 squid/src/errorpage.c:1.167.2.14
*** squid/src/errorpage.c:1.167.2.13 Wed Apr 20 15:33:48 2005
--- squid/src/errorpage.c Fri Mar 10 15:54:38 2006
***************
*** 397,403 ****
requestUnlink(err->request);
safe_free(err->redirect_url);
safe_free(err->url);
- safe_free(err->host);
safe_free(err->dnsserver_msg);
safe_free(err->request_hdrs);
wordlistDestroy(&err->ftp.server_msg);
--- 397,402 ----
***************
*** 493,506 ****
memBufPrintf(&mb, "%s", getMyHostname());
break;
case 'H':
! p = r ? r->host : "[unknown host]";
break;
case 'i':
memBufPrintf(&mb, "%s", inet_ntoa(err->src_addr));
break;
case 'I':
! if (err->host) {
! memBufPrintf(&mb, "%s", err->host);
} else
p = "[unknown]";
break;
--- 492,511 ----
memBufPrintf(&mb, "%s", getMyHostname());
break;
case 'H':
! if (r) {
! if (r->hier.host)
! p = r->hier.host;
! else
! p = r->host;
! } else
! p = "[unknown host]";
break;
case 'i':
memBufPrintf(&mb, "%s", inet_ntoa(err->src_addr));
break;
case 'I':
! if (r && r->hier.host) {
! memBufPrintf(&mb, "%s", r->hier.host);
} else
p = "[unknown]";
break;
Index: squid/src/forward.c
diff -c squid/src/forward.c:1.82.2.16 squid/src/forward.c:1.82.2.17
*** squid/src/forward.c:1.82.2.16 Thu Sep 1 16:14:45 2005
--- squid/src/forward.c Fri Mar 10 15:54:38 2006
***************
*** 224,229 ****
--- 224,231 ----
assert(current != fwdState);
current = fwdState;
assert(fwdState->server_fd == server_fd);
+ if (Config.onoff.log_ip_on_direct && status != COMM_ERR_DNS && fs->code == DIRECT)
+ hierarchyNote(&fwdState->request->hier, fs->code, fd_table[server_fd].ipaddr);
if (status == COMM_ERR_DNS) {
/*
* Only set the dont_retry flag if the DNS lookup fails on
***************
*** 242,266 ****
assert(fs);
err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
err->xerrno = errno;
- if (fs->peer) {
- err->host = xstrdup(fs->peer->host);
- err->port = fs->peer->http_port;
- } else {
- err->host = xstrdup(request->host);
- err->port = request->port;
- }
fwdFail(fwdState, err);
if (fs->peer)
peerConnectFailed(fs->peer);
comm_close(server_fd);
} else {
debug(17, 3) ("fwdConnectDone: FD %d: '%s'\n", server_fd, storeUrl(fwdState->entry));
- if (fs->peer)
- hierarchyNote(&fwdState->request->hier, fs->code, fs->peer->host);
- else if (Config.onoff.log_ip_on_direct)
- hierarchyNote(&fwdState->request->hier, fs->code, fd_table[server_fd].ipaddr);
- else
- hierarchyNote(&fwdState->request->hier, fs->code, request->host);
fd_note(server_fd, storeUrl(fwdState->entry));
fd_table[server_fd].uses++;
if (fs->peer)
--- 244,255 ----
***************
*** 275,283 ****
--- 264,275 ----
{
FwdState *fwdState = data;
StoreEntry *entry = fwdState->entry;
+ FwdServer *fs = fwdState->servers;
ErrorState *err;
debug(17, 2) ("fwdConnectTimeout: FD %d: '%s'\n", fd, storeUrl(entry));
assert(fd == fwdState->server_fd);
+ if (Config.onoff.log_ip_on_direct && fs->code == DIRECT && fd_table[fd].ipaddr[0])
+ hierarchyNote(&fwdState->request->hier, fs->code, fd_table[fd].ipaddr);
if (entry->mem_obj->inmem_hi == 0) {
err = errorCon(ERR_CONNECT_FAIL, HTTP_GATEWAY_TIMEOUT);
err->xerrno = ETIMEDOUT;
***************
*** 440,445 ****
--- 432,441 ----
ctimeout,
fwdConnectTimeout,
fwdState);
+ if (fs->peer)
+ hierarchyNote(&fwdState->request->hier, fs->code, fs->peer->host);
+ else
+ hierarchyNote(&fwdState->request->hier, fs->code, fwdState->request->host);
commConnectStart(fd, host, port, fwdConnectDone, fwdState);
}
Index: squid/src/gopher.c
diff -c squid/src/gopher.c:1.162.2.11 squid/src/gopher.c:1.162.2.12
*** squid/src/gopher.c:1.162.2.11 Sat Sep 10 19:49:53 2005
--- squid/src/gopher.c Fri Mar 10 15:54:38 2006
***************
*** 708,714 ****
ErrorState *err;
err = errorCon(ERR_WRITE_ERROR, HTTP_BAD_GATEWAY);
err->xerrno = errno;
- err->host = xstrdup(gopherState->req->host);
err->port = gopherState->req->port;
err->url = xstrdup(storeUrl(entry));
fwdFail(gopherState->fwdState, err);
--- 708,713 ----
Index: squid/src/ssl.c
diff -c squid/src/ssl.c:1.118.2.12 squid/src/ssl.c:1.118.2.13
*** squid/src/ssl.c:1.118.2.12 Thu Sep 1 14:24:27 2005
--- squid/src/ssl.c Fri Mar 10 15:54:38 2006
***************
*** 428,434 ****
err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
*sslState->status_ptr = HTTP_SERVICE_UNAVAILABLE;
err->xerrno = errno;
- err->host = xstrdup(sslState->host);
err->port = sslState->port;
err->request = requestLink(request);
err->callback = sslErrorComplete;
--- 428,433 ----
***************
*** 469,475 ****
err = errorCon(ERR_CONNECT_FAIL, HTTP_SERVICE_UNAVAILABLE);
*sslState->status_ptr = HTTP_SERVICE_UNAVAILABLE;
err->xerrno = ETIMEDOUT;
- err->host = xstrdup(sslState->host);
err->port = sslState->port;
err->request = requestLink(request);
err->callback = sslErrorComplete;
--- 468,473 ----
Index: squid/src/structs.h
diff -c squid/src/structs.h:1.408.2.50 squid/src/structs.h:1.408.2.51
*** squid/src/structs.h:1.408.2.50 Sat Feb 25 16:01:45 2006
--- squid/src/structs.h Fri Mar 10 15:54:38 2006
***************
*** 1730,1736 ****
request_t *request;
char *url;
int xerrno;
- char *host;
u_short port;
char *dnsserver_msg;
time_t ttl;
--- 1730,1735 ----