mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
[#2738] [Core] Fix illegal argument with torrent_handle.set_max_connections
This commit is contained in:
parent
83cecc0c09
commit
a58ce30e7b
1 changed files with 4 additions and 0 deletions
|
@ -249,6 +249,10 @@ class Torrent(object):
|
||||||
|
|
||||||
|
|
||||||
def set_max_connections(self, max_connections):
|
def set_max_connections(self, max_connections):
|
||||||
|
if max_connections == 0:
|
||||||
|
max_connections = -1
|
||||||
|
elif max_connections == 1:
|
||||||
|
max_connections = 2
|
||||||
self.options["max_connections"] = int(max_connections)
|
self.options["max_connections"] = int(max_connections)
|
||||||
self.handle.set_max_connections(max_connections)
|
self.handle.set_max_connections(max_connections)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue