This commit is contained in:
Kovid Goyal 2011-05-24 13:33:52 -06:00
parent 665105d96c
commit 2fec4aa6c3

View File

@ -221,7 +221,12 @@ class LibraryServer(ContentServer, MobileServer, XMLServer, OPDSServer, Cache,
if not ip or ip.startswith('127.'): if not ip or ip.startswith('127.'):
raise raise
cherrypy.log('Trying to bind to single interface: '+ip) cherrypy.log('Trying to bind to single interface: '+ip)
# Change the host we listen on
cherrypy.config.update({'server.socket_host' : ip}) cherrypy.config.update({'server.socket_host' : ip})
# This ensures that the change is actually applied
cherrypy.server.socket_host = ip
cherrypy.server.httpserver = cherrypy.server.instance = None
cherrypy.engine.start() cherrypy.engine.start()
self.is_running = True self.is_running = True
@ -231,6 +236,8 @@ class LibraryServer(ContentServer, MobileServer, XMLServer, OPDSServer, Cache,
cherrypy.engine.block() cherrypy.engine.block()
except Exception as e: except Exception as e:
self.exception = e self.exception = e
import traceback
traceback.print_exc()
finally: finally:
self.is_running = False self.is_running = False
try: try: