server fix bind() when 5075 in use

This commit is contained in:
Michael Davidsaver
2020-01-29 15:55:45 -08:00
parent 52147c5749
commit b54b9fb78d
3 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -305,10 +305,12 @@ Server::Pvt::Pvt(Config&& conf)
acceptor_loop.call([this, &dummy](){
// from acceptor worker
bool firstiface = true;
for(const auto& addr : effective.interfaces) {
interfaces.emplace_back(addr, effective.tcp_port, this);
if(effective.tcp_port==0)
interfaces.emplace_back(addr, effective.tcp_port, this, firstiface);
if(firstiface || effective.tcp_port==0)
effective.tcp_port = interfaces.back().bind_addr.port();
firstiface = false;
}
for(const auto& addr : effective.beaconDestinations) {