Code: Select all
line 1302: hosts = all_localhosts()Code: Select all
line 1303: multilocal = len(hosts) > 1 and cherryhost in ('localhost', '0.0.0.0')thus, line 1305/1306 will set hosts[1] to '::1' - and that's where things start to break because on IPv4 only hardware this will raise an exception (protocol not supported). And it even doesn't evaluate the new --stack option, thus setting an IPv6 address even in case the user explicitly disables IPv6 by using '--stack ipv4'.
A non intrusive patch that makes use of the new '--stack' option could look like this:
Code: Select all
--- a/SABnzbd-0.6.11/SABnzbd.py 2011-11-29 21:28:21.000000000 +0100
+++ b/SABnzbd-0.6.11/SABnzbd.py 2011-12-01 18:50:30.393379263 +0100
@@ -1302,13 +1302,16 @@
hosts = all_localhosts()
multilocal = len(hosts) > 1 and cherryhost in ('localhost', '0.0.0.0')
- # For 0.0.0.0 CherryPy will always pick IPv4, so make sure the secondary localhost is IPv6
- if multilocal and cherryhost == '0.0.0.0' and hosts[1] == '127.0.0.1':
- hosts[1] = '::1'
-
- # The Windows binary requires numeric localhost as primary address
- if multilocal and cherryhost == 'localhost' and hosts[1] == '127.0.0.1':
- cherryhost = '::1'
+ if 'ipv6' in (stack) or stack == '':
+ # For 0.0.0.0 CherryPy will always pick IPv4, so make sure the secondary localhost is IPv6
+ if multilocal and cherryhost == '0.0.0.0' and hosts[1] == '127.0.0.1':
+ hosts[1] = '::1'
+
+ # The Windows binary requires numeric localhost as primary address
+ if multilocal and cherryhost == 'localhost' and hosts[1] == '127.0.0.1':
+ cherryhost = '::1'
+ else:
+ hosts[1] = '127.0.0.1'
if enable_https:
if https_port:
@@ -1329,7 +1332,10 @@
elif multilocal:
# Extra HTTP port for secondary localhost
attach_server(hosts[1], cherryport)
-
+ else:
+ # if no https and no multilocal, it would be nice if we'd
+ # attach to at least some port, no?
+ attach_server(cherryhost, cherryport)
if no_login:
sabnzbd.cfg.username.set('')Feel free to use, modify, ignore or to tell me where my error is ;-)

