mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 22:06:27 +00:00
fix dht problem with new random ports
This commit is contained in:
parent
a1534878c7
commit
98c6ab7137
19
src/core.py
19
src/core.py
@ -846,12 +846,19 @@ 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:
|
||||||
PREF_FUNCTIONS[pref](self.get_pref(pref))
|
if (PREF_FUNCTIONS[pref] == PREF_FUNCTIONS["listen_on"]):
|
||||||
if self.get_pref("random_port"):
|
if self.get_pref("random_port") == False:
|
||||||
import random
|
PREF_FUNCTIONS[pref](self.get_pref(pref))
|
||||||
ports = [random.randrange(49152, 65535), random.randrange(49152, 65535)]
|
else:
|
||||||
ports.sort()
|
if deluge_core.listening_port() != 0 and deluge_core.listening_port() != self.get_pref("listen_on")[0] and deluge_core.listening_port() != self.get_pref("listen_on")[1]:
|
||||||
deluge_core.set_listen_on(ports)
|
pass
|
||||||
|
else:
|
||||||
|
import random
|
||||||
|
ports = [random.randrange(49152, 65535), random.randrange(49152, 65535)]
|
||||||
|
ports.sort()
|
||||||
|
deluge_core.set_listen_on(ports)
|
||||||
|
else:
|
||||||
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user