Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V6 backports #1986

Open
wants to merge 3 commits into
base: v6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,6 @@ AS_IF([test "x$squid_opt_aufs_threads" != "x"],[
[Defines how many threads aufs uses for I/O])
])

## TODO check if this is necessary, LT_INIT does these checks
SQUID_AUTO_LIB(dl,[dynamic linking],[LIBDL])
AS_IF([test "x$with_dl" != "xno"],[
CXXFLAGS="$LIBDL_CFLAGS $CXXFLAGS"
LDFLAGS="$LIBDL_PATH $LDFLAGS"
AC_CHECK_LIB(dl, dlopen)
])

AC_DEFUN([LIBATOMIC_CHECKER],[
AC_MSG_CHECKING(whether linking $1 -latomic works)
AC_LINK_IFELSE([
Expand Down
1 change: 1 addition & 0 deletions src/acl/ExtUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ACLExtUser : public ACL
char const *typeString() const override;
void parse() override;
int match(ACLChecklist *checklist) override;
bool requiresRequest() const override { return true; }
SBufList dump() const override;
bool empty () const override;

Expand Down
8 changes: 6 additions & 2 deletions src/acl/SourceDomain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ SourceDomainLookup::LookupDone(const char *, const Dns::LookupDetails &details,
{
ACLFilledChecklist *checklist = Filled((ACLChecklist*)data);
checklist->markSourceDomainChecked();
checklist->request->recordLookup(details);
checklist->resumeNonBlockingCheck(SourceDomainLookup::Instance());
if (checklist->request)
checklist->request->recordLookup(details);
else
debugs(28, 3, "no request to recordLookup()");

checklist->resumeNonBlockingCheck();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR incorrectly attributes this resumeNonBLockingCheck() change to PR 1931. That PR (i.e. master/v7 commit 0ef767a) does not change resumeNonBLockingCheck() calls. To backport that commit (without also backporting much more invasive commit 5fb6afe changes), this line/call has to be preserved AFAICT:

Suggested change
checklist->resumeNonBlockingCheck();
checklist->resumeNonBlockingCheck(SourceDomainLookup::Instance());

}

int
Expand Down
35 changes: 22 additions & 13 deletions src/neighbors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ static void neighborAlive(CachePeer *, const MemObject *, const icp_common_t *);
static void neighborAliveHtcp(CachePeer *, const MemObject *, const HtcpReplyData *);
#endif
static void neighborCountIgnored(CachePeer *);
static void peerRefreshDNS(void *);
static void peerDnsRefreshCheck(void *);
static void peerDnsRefreshStart();
static IPH peerDNSConfigure;
static void peerProbeConnect(CachePeer *, const bool reprobeIfBusy = false);
static CNCB peerProbeConnectDone;
Expand Down Expand Up @@ -583,7 +584,7 @@ neighbors_init(void)
}
}

peerRefreshDNS((void *) 1);
peerDnsRefreshStart();

sep = getservbyname("echo", "udp");
echo_port = sep ? ntohs((unsigned short) sep->s_port) : 7;
Expand Down Expand Up @@ -1237,24 +1238,32 @@ peerDNSConfigure(const ipcache_addrs *ia, const Dns::LookupDetails &, void *data
}

static void
peerRefreshDNS(void *data)
peerScheduleDnsRefreshCheck(const double delayInSeconds)
{
CachePeer *p = nullptr;

if (eventFind(peerRefreshDNS, nullptr))
eventDelete(peerRefreshDNS, nullptr);
if (eventFind(peerDnsRefreshCheck, nullptr))
eventDelete(peerDnsRefreshCheck, nullptr);
eventAddIsh("peerDnsRefreshCheck", peerDnsRefreshCheck, nullptr, delayInSeconds, 1);
}

if (!data && 0 == stat5minClientRequests()) {
static void
peerDnsRefreshCheck(void *)
{
if (!stat5minClientRequests()) {
/* no recent client traffic, wait a bit */
eventAddIsh("peerRefreshDNS", peerRefreshDNS, nullptr, 180.0, 1);
peerScheduleDnsRefreshCheck(180.0);
return;
}

for (p = Config.peers; p; p = p->next)
ipcache_nbgethostbyname(p->host, peerDNSConfigure, p);
peerDnsRefreshStart();
}

static void
peerDnsRefreshStart()
{
for (const auto &p: CurrentCachePeers())
ipcache_nbgethostbyname(p->host, peerDNSConfigure, p.get());

/* Reconfigure the peers every hour */
eventAddIsh("peerRefreshDNS", peerRefreshDNS, nullptr, 3600.0, 1);
peerScheduleDnsRefreshCheck(3600.0);
}

/// whether new TCP probes are currently banned
Expand Down
Loading