0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

modules/net_dns_resolver: Improve tag.last state decisions for timeouts.

This commit is contained in:
Jason Volk 2019-07-24 14:14:27 -07:00
parent cd3d2c1c8c
commit 9c7ad47e59

View file

@ -355,7 +355,6 @@ ircd::net::dns::resolver::check_timeout(const uint16_t &id,
host(tag.hp)
};
tag.last = steady_point::min();
if(tag.tries < size_t(retry_max))
{
submit(tag);
@ -442,6 +441,7 @@ ircd::net::dns::resolver::queue_query(tag &tag)
if(std::find(begin(sendq), end(sendq), tag.id) != end(sendq))
return;
tag.last = steady_point::min(); // tag to be ignored by the timeout worker
sendq.emplace_back(tag.id);
log::debug
@ -642,7 +642,6 @@ ircd::net::dns::resolver::handle_reply(const ipport &from,
};
assert(tag.tries > 0);
tag.last = steady_point::min();
submit(tag);
return;
}
@ -655,7 +654,7 @@ ircd::net::dns::resolver::handle_reply(const ipport &from,
}};
assert(tag.tries > 0);
tag.last = steady_point::min();
tag.last = steady_point::min(); // tag ignored by the timeout worker during handling.
tag.rcode = header.rcode;
handle_reply(header, body, tag);
}
@ -818,6 +817,9 @@ ircd::net::dns::resolver::error_one(tag &tag,
what(eptr)
};
// value causes tag to be ignored by the timeout worker
tag.last = steady_point::min();
static const answers empty;
callback(eptr, tag, empty);