Go back to not passing just the server into protocols

This commit is contained in:
Andrew Godwin 2016-02-10 20:30:36 +00:00
parent ccd8d18da8
commit 011ec23333
2 changed files with 4 additions and 4 deletions

View File

@ -155,10 +155,10 @@ class HTTPFactory(http.HTTPFactory):
protocol = HTTPProtocol protocol = HTTPProtocol
def __init__(self, server): def __init__(self, channel_layer, action_logger=None):
http.HTTPFactory.__init__(self) http.HTTPFactory.__init__(self)
self.channel_layer = server.channel_layer self.channel_layer = channel_layer
self.action_logger = server.action_logger self.action_logger = action_logger
# We track all sub-protocols for response channel mapping # We track all sub-protocols for response channel mapping
self.reply_protocols = {} self.reply_protocols = {}
# Make a factory for WebSocket protocols # Make a factory for WebSocket protocols

View File

@ -14,7 +14,7 @@ class Server(object):
self.action_logger = action_logger self.action_logger = action_logger
def run(self): def run(self):
self.factory = HTTPFactory(self) self.factory = HTTPFactory(self.channel_layer, self.action_logger)
reactor.listenTCP(self.port, self.factory, interface=self.host) reactor.listenTCP(self.port, self.factory, interface=self.host)
reactor.callInThread(self.backend_reader) reactor.callInThread(self.backend_reader)
reactor.run(installSignalHandlers=self.signal_handlers) reactor.run(installSignalHandlers=self.signal_handlers)