vinfolog("Got answer from %s, relayed to %s, took %f usec", state->remote.toStringWithPort(), ids->origRemote.toStringWithPort(), udiff);
{
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
std::lock_guard<std::mutex> lock(g_rings.respMutex);
- g_rings.respRing.push_back({ids->qname, ids->qtype, (uint8_t)dh->rcode, (unsigned int)udiff});
+ g_rings.respRing.push_back({ts, ids->origRemote, ids->qname, ids->qtype, (uint8_t)dh->rcode, (unsigned int)udiff, (unsigned int)len});
}
if(dh->rcode == 2)
g_stats.servfailResponses++;
return 0;
}
-bool operator<(const struct timespec&a, const struct timespec& b)
-{
- return std::tie(a.tv_sec, a.tv_nsec) < std::tie(b.tv_sec, b.tv_nsec);
-}
-
-
DownstreamState::DownstreamState(const ComboAddress& remote_): checkName("a.root-servers.net."), checkType(QType::A), mustResolve(false)
{
remote = remote_;
ids.origFD = -1;
dss->reuseds++;
--dss->outstanding;
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
std::lock_guard<std::mutex> lock(g_rings.respMutex);
- g_rings.respRing.push_back({ids.qname, ids.qtype, 0, 2000000});
+ g_rings.respRing.push_back({ts, ids.origRemote, ids.qname, ids.qtype, 0, 2000000, 0});
}
}
}
+
+ std::lock_guard<std::mutex> lock(g_luamutex);
+ auto f =g_lua.readVariable<boost::optional<std::function<void()> > >("maintenance");
+ if(f)
+ (*f)();
}
return 0;
}
boost::circular_buffer<DNSName> queryRing;
struct Response
{
+ struct timespec when;
+ ComboAddress requestor;
DNSName name;
uint16_t qtype;
uint8_t rcode;
unsigned int usec;
+ unsigned int size;
};
boost::circular_buffer<Response> respRing;
std::mutex respMutex;
bool getMsgLen(int fd, uint16_t* len);
bool putMsgLen(int fd, uint16_t len);
void* tcpAcceptorThread(void* p);
+
+void moreLua();
return make_pair(lhs.tv_sec, lhs.tv_usec) < make_pair(rhs.tv_sec, rhs.tv_usec);
}
+inline bool operator<(const struct timespec& lhs, const struct timespec& rhs)
+{
+ return tie(lhs.tv_sec, lhs.tv_nsec) < tie(rhs.tv_sec, rhs.tv_nsec);
+}
+
+
inline bool pdns_ilexicographical_compare(const std::string& a, const std::string& b) __attribute__((pure));
inline bool pdns_ilexicographical_compare(const std::string& a, const std::string& b)
{