From 639cc297d2ca40bd1d5099a75f18b80bcdae2bb0 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sat, 28 Jul 2007 21:57:44 +0000 Subject: [PATCH] account for the entire range of ports that the user has in preferences --- src/core.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core.py b/src/core.py index 279a08a86..f02aadc29 100644 --- a/src/core.py +++ b/src/core.py @@ -850,10 +850,11 @@ class Manager: if self.get_pref("random_port") == False: PREF_FUNCTIONS[pref](self.get_pref(pref)) else: - 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]: - pass + if deluge_core.listening_port() != 0: + for i in xrange(int(self.get_pref("listen_on")[0]),\ + int(self.get_pref("listen_on")[1])): + if deluge_core.listening_port() != i: + pass else: import random ports = [random.randrange(49152, 65535), random.randrange(49152, 65535)]