mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
ircd::server: Ensure open_opts references are fresh after resolve comes back.
This commit is contained in:
parent
6488141f64
commit
0012793bf6
1 changed files with 9 additions and 4 deletions
|
@ -104,12 +104,12 @@ ircd::server::create(const net::hostport &hostport)
|
|||
{
|
||||
auto peer(std::make_unique<peer>());
|
||||
peer->hostname = net::canonize(hostport);
|
||||
peer->resolve(hostport);
|
||||
peer->open_opts = net::open_opts
|
||||
{
|
||||
peer->remote, net::hostport{peer->hostname}
|
||||
};
|
||||
|
||||
peer->resolve(hostport);
|
||||
return peer;
|
||||
}
|
||||
|
||||
|
@ -872,13 +872,18 @@ try
|
|||
|
||||
this->remote = ipport;
|
||||
open_opts.ipport = this->remote;
|
||||
host(open_opts.hostport) = this->hostname;
|
||||
port(open_opts.hostport) = port(ipport);
|
||||
open_opts.common_name = this->hostname;
|
||||
|
||||
if(unlikely(finished()))
|
||||
return handle_finished();
|
||||
|
||||
if(!op_fini)
|
||||
if(op_fini)
|
||||
return;
|
||||
|
||||
for(auto &link : links)
|
||||
link.open(this->open_opts);
|
||||
link.open(open_opts);
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue