}
if (g_rings.shouldRecordResponses()) {
- timespec ts{};
- gettime(&ts);
+ timespec now{};
+ gettime(&now);
dnsheader fake{};
memset(&fake, 0, sizeof(fake));
uint16_t* flags = getFlagsFromDNSHeader(&fake);
*flags = ids.internal.origFlags;
- g_rings.insertResponse(ts, ids.internal.origRemote, ids.internal.qname, ids.internal.qtype, std::numeric_limits<unsigned int>::max(), 0, fake, d_config.remote, getProtocol());
+ g_rings.insertResponse(now, ids.internal.origRemote, ids.internal.qname, ids.internal.qtype, std::numeric_limits<unsigned int>::max(), 0, fake, d_config.remote, getProtocol());
}
reportTimeoutOrError();
return std::nullopt;
}
- int randomVal = val % sum;
+ int randomVal = static_cast<int>(val % sum);
auto selected = std::upper_bound(poss.begin(), poss.begin() + usableServers, randomVal, [](int randomVal_, const typename T::value_type& serverPair) { return randomVal_ < serverPair.first;});
if (selected == poss.begin() + usableServers) {
return std::nullopt;