Skip to content

Commit

Permalink
Merge pull request #1028 from vktr/feature/fix-listen-interface-crash…
Browse files Browse the repository at this point in the history
…-loop

Sanity check listen interfaces and DHT bootstrap nodes
  • Loading branch information
vktr committed Nov 22, 2020
2 parents 280fe10 + 8f903cd commit ffba918
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/picotorrent/bittorrent/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,15 @@ static lt::settings_pack getSettingsPack(std::shared_ptr<pt::Core::Configuration
outfaces << "," << li.address;
}

settings.set_str(lt::settings_pack::dht_bootstrap_nodes, dhtNodes.str().substr(1));
settings.set_str(lt::settings_pack::listen_interfaces, ifaces.str().substr(1));
if (dhtNodes.str().size() > 0)
{
settings.set_str(lt::settings_pack::dht_bootstrap_nodes, dhtNodes.str().substr(1));
}

if (ifaces.str().size() > 0)
{
settings.set_str(lt::settings_pack::listen_interfaces, ifaces.str().substr(1));
}

if (outfaces.str().size() > 0)
{
Expand Down

0 comments on commit ffba918

Please sign in to comment.