mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::server: Add peer to map before resolve.
This commit is contained in:
parent
eee620df3e
commit
e62e65df6b
1 changed files with 3 additions and 3 deletions
|
@ -136,8 +136,11 @@ ircd::server::get(const net::hostport &hostport)
|
|||
canonized
|
||||
};
|
||||
|
||||
assert(bool(peer));
|
||||
assert(!empty(peer->hostcanon));
|
||||
const string_view key{peer->hostcanon};
|
||||
it = peers.emplace_hint(it, key, std::move(peer));
|
||||
it->second->resolve(it->second->open_opts.hostport);
|
||||
assert(it->second->hostcanon.data() == it->first.data());
|
||||
assert(key == canonized);
|
||||
}
|
||||
|
@ -153,9 +156,6 @@ ircd::server::create(const net::hostport &hostport)
|
|||
std::make_unique<server::peer>(hostport)
|
||||
};
|
||||
|
||||
// Async DNS resolve. The links for the new peer will be connected
|
||||
// once the resolver calls back into peer::handle_resolve().
|
||||
peer->resolve(peer->open_opts.hostport);
|
||||
return peer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue