mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
modules/s_dns: Condition response waiting on callback being non-null.
This commit is contained in:
parent
8c27cb847a
commit
23785910b0
1 changed files with 4 additions and 2 deletions
|
@ -101,7 +101,9 @@ ircd::net::dns::resolve(const hostport &hp,
|
|||
if(cache::get(hp, opts, cb))
|
||||
return;
|
||||
|
||||
cache::waiting.emplace_back(hp, opts, std::move(cb));
|
||||
if(cb)
|
||||
cache::waiting.emplace_back(hp, opts, std::move(cb));
|
||||
|
||||
resolver_call(hp, opts);
|
||||
}
|
||||
|
||||
|
@ -593,7 +595,7 @@ ircd::net::dns::cache::get(const hostport &hp,
|
|||
return expired(rr, ts);
|
||||
});
|
||||
|
||||
if(ret)
|
||||
if(ret && closure)
|
||||
closure(hp, rrs);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue