httpserve
  • Overview
  • Repository
  • Tickets
  • Statistics

Repository

Fix port ranging parsing (include higher bound)

Parent commits : a67806d533982e10610bdb0f024b9d4a5fc2017d,
Children commits : e66a50b0f4d6c59c62ebd471099474f5494c6f0e,

By Laurent Defert on 2013-06-23 18:52:14
Fix port ranging parsing (include higher bound)

Browse content
Difference with parent commit a67806d533982e10610bdb0f024b9d4a5fc2017d
Files modified:
httpserve.py
--- 
+++ 
@@ -596,7 +596,6 @@
             filename = path.rsplit('/', 1)[1]
         files[filename] = {'path': path}
 
-    # Probe for an available port
     ports = []
     if ',' in args.listen_port:
         ports = args.listen_port.split(',')
@@ -604,6 +603,7 @@
     elif '-' in args.listen_port:
         ports = args.listen_port.split('-', 1)
         ports = [int(port) for port in ports]
+        ports[1] += 1
         ports = range(*ports)
     else:
         ports = [int(args.listen_port)]
@@ -624,7 +624,7 @@
         }
         args.ssl_proto = SSL_PROTO[args.ssl_proto]
 
-    # Convert ip addresses
+    # Probe for an available port
     for port in ports:
         try:
             serve_on(port, args)