From: Amos Jeffries Date: Fri, 13 Aug 2010 04:42:26 +0000 (+1200) Subject: Merge from trunk X-Git-Tag: take08~55^2~124^2~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d74ef7169637941a6d7bca6cd08bbf56ab107637;p=thirdparty%2Fsquid.git Merge from trunk --- d74ef7169637941a6d7bca6cd08bbf56ab107637 diff --cc src/comm/ListenStateData.cc index 10980d8d9f,838d7ff5f7..78f11c528f --- a/src/comm/ListenStateData.cc +++ b/src/comm/ListenStateData.cc @@@ -204,9 -169,9 +201,9 @@@ Comm::ListenStateData::acceptOne( } debugs(5, 5, HERE << "accepted: FD " << fd << - " newfd: " << newfd << " from: " << connDetails.peer << + " newfd: " << newfd << " from: " << connDetails->remote << " handler: " << theCallback); - notify(newfd, COMM_OK, 0, connDetails); + notify(newfd, COMM_OK, connDetails); } void @@@ -218,7 -183,7 +215,7 @@@ Comm::ListenStateData::acceptNext( } void - Comm::ListenStateData::notify(int newfd, comm_err_t errcode, int xerrno, Comm::ConnectionPointer connDetails) -Comm::ListenStateData::notify(int newfd, comm_err_t flag, const ConnectionDetail &connDetails) ++Comm::ListenStateData::notify(int newfd, comm_err_t flag, const Comm::ConnectionPointer &connDetails) { // listener socket handlers just abandon the port with COMM_ERR_CLOSING // it should only happen when this object is deleted... @@@ -251,11 -216,13 +248,13 @@@ Comm::ListenStateData::oldAccept(Comm:: statCounter.syscalls.sock.accepts++; int sock; struct addrinfo *gai = NULL; - details.me.InitAddrInfo(gai); + details.local.InitAddrInfo(gai); + errcode = 0; // reset local errno copy. if ((sock = accept(fd, gai->ai_addr, &gai->ai_addrlen)) < 0) { + errcode = errno; // store last accept errno locally. - details.me.FreeAddrInfo(gai); + details.local.FreeAddrInfo(gai); PROF_stop(comm_accept); diff --cc src/comm/ListenStateData.h index 65609fd6d9,b8e3c9057b..bd0ca895bd --- a/src/comm/ListenStateData.h +++ b/src/comm/ListenStateData.h @@@ -22,9 -21,9 +22,9 @@@ public ListenStateData(const ListenStateData &r); // not implemented. ~ListenStateData(); - void subscribe(AsyncCall::Pointer &call); + void subscribe(AsyncCall::Pointer &call) { theCallback = call; }; void acceptNext(); - void notify(int newfd, comm_err_t, int xerrno, Comm::ConnectionPointer); - void notify(int newfd, comm_err_t flag, const ConnectionDetail &details); ++ void notify(int newfd, comm_err_t flag, const Comm::ConnectionPointer &details); int fd; diff --cc src/dns_internal.cc index 661f3bcb37,ce0c5bd6f2..fb91dc18aa --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@@ -195,14 -194,19 +195,19 @@@ idnsAddNameserver(const char *buf Ip::Address A; if (!(A = buf)) { -- debugs(78, 0, "WARNING: rejecting '" << buf << "' as a name server, because it is not a numeric IP address"); ++ debugs(78, DBG_CRITICAL, "WARNING: rejecting '" << buf << "' as a name server, because it is not a numeric IP address"); return; } if (A.IsAnyAddr()) { -- debugs(78, 0, "WARNING: Squid does not accept " << A << " in DNS server specifications."); - A = "127.0.0.1"; - debugs(78, 0, "Will be using " << A << " instead, assuming you meant that DNS is running on the same machine"); ++ debugs(78, DBG_CRITICAL, "WARNING: Squid does not accept " << A << " in DNS server specifications."); + A.SetLocalhost(); - debugs(78, 0, "Will be using " << A << " instead, assuming you meant that DNS is running on the same machine"); ++ debugs(78, DBG_CRITICAL, "Will be using " << A << " instead, assuming you meant that DNS is running on the same machine"); + } + + if (!Ip::EnableIpv6 && !A.SetIPv4()) { + debugs(78, DBG_IMPORTANT, "WARNING: IPv6 is disabled. Discarding " << A << " in DNS server specifications."); + return; } if (nns == nns_alloc) { diff --cc src/forward.cc index 2c577acbda,41f1fabb4d..9b9ed85b2e --- a/src/forward.cc +++ b/src/forward.cc @@@ -52,10 -48,9 +52,9 @@@ #include "Store.h" #include "icmp/net_db.h" #include "ip/Intercept.h" --#include "ip/tools.h" -static PSC fwdStartCompleteWrapper; + +static PSC fwdPeerSelectionCompleteWrapper; static PF fwdServerClosedWrapper; #if USE_SSL static PF fwdNegotiateSSLWrapper; diff --cc src/http.cc index 5fe58b1d19,6e922bb544..e9c2b2ed7c --- a/src/http.cc +++ b/src/http.cc @@@ -2081,9 -2081,9 +2081,9 @@@ httpStart(FwdState *fwd void HttpStateData::doneSendingRequestBody() { - debugs(11,5, HERE << "doneSendingRequestBody: FD " << fd); + debugs(11,5, HERE << "doneSendingRequestBody: FD " << serverConnection->fd); - #if HTTP_VIOLATIONS + #if USE_HTTP_VIOLATIONS if (Config.accessList.brokenPosts) { ACLFilledChecklist ch(Config.accessList.brokenPosts, request, NULL); if (!ch.fastCheck()) { @@@ -2109,11 -2109,11 +2109,11 @@@ return; } debugs(11, 5, "doneSendingRequestBody: No brokenPosts list"); - #endif /* HTTP_VIOLATIONS */ + #endif /* USE_HTTP_VIOLATIONS */ CommIoCbParams io(NULL); - io.fd=fd; - io.flag=COMM_OK; + io.fd = serverConnection->fd; + io.flag = COMM_OK; sendComplete(io); }