Skip to content
This repository
Browse code

Fix empty_port finder

git-svn-id: svn://cherokee-project.com/cherokee/trunk@5587 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
commit 8b95ba50326e6594f7c94b8ab4f799a9c5aea645 1 parent 69de07e
authored October 01, 2010

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  admin/util.py
8  admin/util.py
@@ -176,8 +176,12 @@ def cfg_source_find_empty_port (n_ports=1):
176 176
         ports.append (port)
177 177
 
178 178
     pport = 1025
179  
-    for x in ports:
180  
-        if pport + n_ports < x:
  179
+    while pport+n_ports < 65535:
  180
+        pports = range(pport, pport + n_ports)
  181
+        for x in pports:
  182
+            if x in ports:
  183
+                pport += 1
  184
+                break
181 185
             return pport
182 186
 
183 187
     assert (False)

0 notes on commit 8b95ba5

Please sign in to comment.
Something went wrong with that request. Please try again.