From e62e65df6bdb944ed3723833e0a10c762ded0cfa Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 22 Mar 2019 10:51:11 -0700 Subject: [PATCH] ircd::server: Add peer to map before resolve. --- ircd/server.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ircd/server.cc b/ircd/server.cc index f0613bf6e..e05c9617c 100644 --- a/ircd/server.cc +++ b/ircd/server.cc @@ -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(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; }