From 0b5536766458a6a466a5e39ae066910f23826979 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 30 Mar 2007 03:24:37 +0000 Subject: [PATCH] fix related to listen port --- src/session_impl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index cfc3ca36d..e4f10b30f 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -965,7 +965,7 @@ namespace libtorrent { namespace detail { torrent& t = *i->second; assert(!t.is_aborted()); - if (t.should_request() && m_external_listen_port > 0) + if (t.should_request()) { tracker_request req = t.generate_tracker_request(); req.listen_port = m_external_listen_port; @@ -1224,6 +1224,10 @@ namespace libtorrent { namespace detail , int block_size , storage_constructor_type sc) { + // if you get this assert, you haven't managed to + // open a listen port. call listen_on() first. + assert(m_external_listen_port > 0); + // make sure the block_size is an even power of 2 #ifndef NDEBUG for (int i = 0; i < 32; ++i)