mirror of
https://github.com/matrix-construct/construct
synced 2025-03-13 21:10:32 +01:00
modules/net_dns_resolver: Improve tag.last state decisions for timeouts.
This commit is contained in:
parent
cd3d2c1c8c
commit
9c7ad47e59
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue