diff --git a/include/libtorrent/session.hpp b/include/libtorrent/session.hpp index f2f107780..3fee69802 100644 --- a/include/libtorrent/session.hpp +++ b/include/libtorrent/session.hpp @@ -239,6 +239,8 @@ namespace libtorrent pack.set_int(settings_pack::max_retry_port_bind, listen_port_range.second - listen_port_range.first); pack.set_str(settings_pack::peer_fingerprint, print.to_string()); char if_string[100]; + + if (listen_interface == NULL) listen_interface = "0.0.0.0"; snprintf(if_string, sizeof(if_string), "%s:%d", listen_interface, listen_port_range.first); pack.set_str(settings_pack::listen_interfaces, if_string); diff --git a/src/session.cpp b/src/session.cpp index 9d3913fda..e844bff29 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -355,7 +355,7 @@ namespace libtorrent ::_set_se_translator(straight_to_debugger); #endif - bool internal_executor = ios == NULL; + bool const internal_executor = ios == NULL; if (internal_executor) { diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 2892a63d8..15495bb56 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -464,7 +464,10 @@ namespace aux { // post it to the io_service? void session_impl::start_session(settings_pack const& pack) { - m_alerts.set_alert_mask(pack.get_int(settings_pack::alert_mask)); + if (pack.has_val(settings_pack::alert_mask)) + { + m_alerts.set_alert_mask(pack.get_int(settings_pack::alert_mask)); + } #ifndef TORRENT_DISABLE_LOGGING session_log("start session");