assert(chain.first->key->domain == pident->domain); // NOLINT
// don't chain onto existing chained waiter or a chain already processed
if (chain.first->key->fd > -1 && !chain.first->key->closed) {
- *fileDesc = -1;
+ chain.first->key->chain.insert(qid); // we can chain
+ *fileDesc = -1; // gets used in waitEvent / sendEvent later on
return LWResult::Result::Success;
}
}
}
}
-void mthreadSleep(unsigned int jitterMsec)
-{
- auto neverHappens = std::make_shared<PacketID>();
- neverHappens->id = dns_random_uint16();
- neverHappens->type = dns_random_uint16();
- neverHappens->remote = ComboAddress("100::"); // discard-only
- neverHappens->remote.setPort(dns_random_uint16());
- neverHappens->fd = -1;
- assert(g_multiTasker->waitEvent(neverHappens, nullptr, jitterMsec) != -1); // NOLINT
-}
-
static bool checkIncomingECSSource(const PacketBuffer& packet, const Netmask& subnet)
{
bool foundMatchingECS = false;
registerCounter64Stat("udr-events", udrEventsOID, OID_LENGTH(udrEventsOID));
registerCounter64Stat("max-chain-length", maxChainLengthOID, OID_LENGTH(maxChainLengthOID));
registerCounter64Stat("max-chain-weight", maxChainWeightOID, OID_LENGTH(maxChainWeightOID));
+ registerCounter64Stat("chain-limits", chainLimitsOID, OID_LENGTH(chainLimitsOID));
registerCounter64Stat("tcp-overflow", tcpOverflowOID, OID_LENGTH(tcpOverflowOID));
registerCounter64Stat("ecs-missing", ecsMissingOID, OID_LENGTH(ecsMissingOID));
}
}
-void SyncRes::incTimeoutStats(const ComboAddress& remoteIP)
-{
- d_timeouts++;
- t_Counters.at(rec::Counter::outgoingtimeouts)++;
-
- if (remoteIP.sin4.sin_family == AF_INET) {
- t_Counters.at(rec::Counter::outgoing4timeouts)++;
- }
- else {
- t_Counters.at(rec::Counter::outgoing6timeouts)++;
- }
-
- if (t_timeouts) {
- t_timeouts->push_back(remoteIP);
- }
-}
-
void SyncRes::checkTotalTime(const DNSName& qname, QType qtype, boost::optional<EDNSExtendedError>& extendedError) const
{
if (s_maxtotusec != 0 && d_totUsec > s_maxtotusec) {
unsigned int depth, const string& prefix, set<GetBestNSAnswer>& beenthere, Context& context, StopAtDelegation* stopAtDelegation,
std::map<DNSName, std::vector<ComboAddress>>* fallback);
void ednsStats(boost::optional<Netmask>& ednsmask, const DNSName& qname, const string& prefix);
- void incTimeoutStats(const ComboAddress& remoteIP);
void checkTotalTime(const DNSName& qname, QType qtype, boost::optional<EDNSExtendedError>& extendedError) const;
bool doResolveAtThisIP(const std::string& prefix, const DNSName& qname, QType qtype, LWResult& lwr, boost::optional<Netmask>& ednsmask, const DNSName& auth, bool sendRDQuery, bool wasForwarded, const DNSName& nsName, const ComboAddress& remoteIP, bool doTCP, bool doDoT, bool& truncated, bool& spoofed, boost::optional<EDNSExtendedError>& extendedError, bool dontThrottle = false);
bool processAnswer(unsigned int depth, const string& prefix, LWResult& lwr, const DNSName& qname, QType qtype, DNSName& auth, bool wasForwarded, const boost::optional<Netmask>& ednsmask, bool sendRDQuery, NsSet& nameservers, std::vector<DNSRecord>& ret, const DNSFilterEngine& dfe, bool* gotNewServers, int* rcode, vState& state, const ComboAddress& remoteIP);