account for the entire range of ports that the user has in preferences

This commit is contained in:
Marcos Pinto 2007-07-28 21:57:44 +00:00
parent 83d45c4626
commit 639cc297d2
1 changed files with 5 additions and 4 deletions

View File

@ -850,10 +850,11 @@ class Manager:
if self.get_pref("random_port") == False: if self.get_pref("random_port") == False:
PREF_FUNCTIONS[pref](self.get_pref(pref)) PREF_FUNCTIONS[pref](self.get_pref(pref))
else: else:
if deluge_core.listening_port() != 0 and \ if deluge_core.listening_port() != 0:
deluge_core.listening_port() != self.get_pref("listen_on")[0] \ for i in xrange(int(self.get_pref("listen_on")[0]),\
and deluge_core.listening_port() != self.get_pref("listen_on")[1]: int(self.get_pref("listen_on")[1])):
pass if deluge_core.listening_port() != i:
pass
else: else:
import random import random
ports = [random.randrange(49152, 65535), random.randrange(49152, 65535)] ports = [random.randrange(49152, 65535), random.randrange(49152, 65535)]