Fix attempt for #1560

This commit is contained in:
blitzmann
2018-05-18 01:18:46 -04:00
parent 22edebbf9b
commit caf31517ca

View File

@@ -103,11 +103,18 @@ class AuthHandler(http.server.BaseHTTPRequestHandler):
def log_message(self, format, *args):
return
import socketserver
# http://code.activestate.com/recipes/425210-simple-stoppable-server-using-socket-timeout/
class StoppableHTTPServer(http.server.HTTPServer):
class StoppableHTTPServer(socketserver.TCPServer):
def server_bind(self):
http.server.HTTPServer.server_bind(self)
# Can't use HTTPServer due to reliance on socket.getfqdn() which seems to be bugged.
# See https://github.com/pyfa-org/Pyfa/issues/1560#issuecomment-390095101
socketserver.TCPServer.server_bind(self)
host, port = self.server_address[:2]
self.server_name = host
self.server_port = port
# self.settings = CRESTSettings.getInstance()
# Allow listening for x seconds