From 3db83faac3a06dbccb2bd7d736d1ba510b574c4b Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 22 Mar 2019 15:13:55 -0700 Subject: [PATCH] ircd::server: Fix concurrency assumptions in server::get(). --- ircd/server.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ircd/server.cc b/ircd/server.cc index 43ab2453b..1c7d94d88 100644 --- a/ircd/server.cc +++ b/ircd/server.cc @@ -115,7 +115,7 @@ ircd::server::interrupt_all() ircd::server::peer & ircd::server::get(const net::hostport &hostport) { - thread_local char canonbuf[512]; + char canonbuf[256]; const auto canonized { net::canonize(canonbuf, hostport) @@ -140,7 +140,6 @@ ircd::server::get(const net::hostport &hostport) 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); } @@ -156,6 +155,7 @@ ircd::server::create(const net::hostport &hostport) std::make_unique(hostport) }; + peer->resolve(peer->open_opts.hostport); return peer; }