mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
get dht back working for now
This commit is contained in:
parent
396a245d84
commit
f9f1b95a4e
1 changed files with 20 additions and 9 deletions
29
src/core.py
29
src/core.py
|
@ -855,17 +855,28 @@ class Manager:
|
||||||
|
|
||||||
for pref in PREF_FUNCTIONS:
|
for pref in PREF_FUNCTIONS:
|
||||||
if PREF_FUNCTIONS[pref] is not None:
|
if PREF_FUNCTIONS[pref] is not None:
|
||||||
if pref == "listen_on" and self.get_pref("random_port"):
|
if (PREF_FUNCTIONS[pref] == PREF_FUNCTIONS["listen_on"]):
|
||||||
import random
|
if self.get_pref("random_port") == False:
|
||||||
|
PREF_FUNCTIONS[pref](self.get_pref(pref))
|
||||||
randrange = lambda: random.randrange(49152, 65535)
|
else:
|
||||||
|
if deluge_core.listening_port() != 0:
|
||||||
ports = [randrange(), randrange()]
|
for i in xrange(int(self.get_pref("listen_on")[0]),\
|
||||||
ports.sort()
|
int(self.get_pref("listen_on")[1])):
|
||||||
deluge_core.set_listen_on(ports)
|
if deluge_core.listening_port() != i:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
import random
|
||||||
|
ports = [random.randrange(49152, 65535), random.randrange(49152, 65535)]
|
||||||
|
ports.sort()
|
||||||
|
deluge_core.set_listen_on(ports)
|
||||||
|
else:
|
||||||
|
import random
|
||||||
|
ports = [random.randrange(49152, 65535), random.randrange(49152, 65535)]
|
||||||
|
ports.sort()
|
||||||
|
deluge_core.set_listen_on(ports)
|
||||||
else:
|
else:
|
||||||
PREF_FUNCTIONS[pref](self.get_pref(pref))
|
PREF_FUNCTIONS[pref](self.get_pref(pref))
|
||||||
|
|
||||||
# We need to reapply priorities to files after preferences were
|
# We need to reapply priorities to files after preferences were
|
||||||
# changed
|
# changed
|
||||||
for unique_ID in self.unique_IDs:
|
for unique_ID in self.unique_IDs:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue