From 4513fee3e59edd689bfc1a6d70c4ff58584af2f0 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sun, 11 Aug 2013 20:41:47 -0300 Subject: [PATCH] use the right torrent port from the start, not need to change it later --- libtorrent/include/libtorrent/session.hpp | 4 ++-- src/twister.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libtorrent/include/libtorrent/session.hpp b/libtorrent/include/libtorrent/session.hpp index f241a5fa..e4b2dc2e 100644 --- a/libtorrent/include/libtorrent/session.hpp +++ b/libtorrent/include/libtorrent/session.hpp @@ -139,11 +139,11 @@ namespace libtorrent , LIBTORRENT_VERSION_MAJOR, LIBTORRENT_VERSION_MINOR, 0, 0) , int flags = start_default_features | add_default_plugins , boost::uint32_t alert_mask = alert::error_notification - , char const* ext_ip = NULL + , char const* ext_ip = NULL, std::pair listen_range = std::make_pair(0, 0) TORRENT_LOGPATH_ARG_DEFAULT) { TORRENT_CFG(); - init(std::make_pair(0, 0), "0.0.0.0", print, alert_mask, ext_ip); + init(listen_range, "0.0.0.0", print, alert_mask, ext_ip); #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING set_log_path(logpath); #endif diff --git a/src/twister.cpp b/src/twister.cpp index 2d3a762c..0ac23d3e 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -149,7 +149,8 @@ void ThreadWaitExtIP() ses = new session(fingerprint("TW", LIBTORRENT_VERSION_MAJOR, LIBTORRENT_VERSION_MINOR, 0, 0) , session::add_default_plugins , alert::dht_notification - , ipStr.size() ? ipStr.c_str() : NULL ); + , ipStr.size() ? ipStr.c_str() : NULL + , std::make_pair(listen_port, listen_port)); std::vector in; boost::filesystem::path sesStatePath = GetDataDir() / "ses_state";