#2738: Illegal argument to libtorrent set_max_connections
-------------------+---------------------------
 Reporter:  bro    |      Owner:
     Type:  bug    |     Status:  new
 Priority:  minor  |  Milestone:  Future
Component:  Core   |    Version:  develop (git)
 Keywords:         |
-------------------+---------------------------
 When testing a debug build of libtorrent I noticed that it fails on an
 assert statement that tests for valid input to the
 torrent_handle.set_max_connections

 [http://www.libtorrent.org/reference-Core.html#torrent-handle Libtorrent
 docs] says that
   This must be at least 2. The default is unlimited number of connections.
 If -1 is given to the function, it means unlimited.

 During startup, deluge passes 0 to this function for some of the torrents.
 Oddly enough, lt actually treats 0 and -1 equally:
 {{{
 #!div style="font-size: 80%"
   {{{#!cpp
   if (limit <= 0) limit = (1<<24)-1;
   }}}
 }}}
 I'm not sure what really happens when passing in 1.

 There are two different asserts:

 {{{
 #!div style="font-size: 80%"
 set_max_connections (torrent_handle.cpp)
   {{{#!cpp
 TORRENT_ASSERT_PRECOND(max_connections >= 2 || max_connections == -1);
   }}}
 }}}


 {{{
 #!div style="font-size: 80%"
 set_max_connections (torrent.cpp)
   {{{#!cpp
 TORRENT_ASSERT(limit >= -1);
   }}}
 }}}

 This could indicate that it's only a bug in the lt doc and the assert in
 torrent_handle.cpp, i.e., 1 and 0 are also valid values.

-- 
Ticket URL: <http://dev.deluge-torrent.org/ticket/2738>
Deluge <http://deluge-torrent.org/>
Deluge Project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to