}
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
}
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...
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);
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;
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) {
#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;
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()) {
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);
}