From 011ec23333f4886c48bdeeeaeec998b862038538 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Wed, 10 Feb 2016 20:30:36 +0000 Subject: [PATCH] Go back to not passing just the server into protocols --- daphne/http_protocol.py | 6 +++--- daphne/server.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daphne/http_protocol.py b/daphne/http_protocol.py index 0a34deb..8187c6c 100755 --- a/daphne/http_protocol.py +++ b/daphne/http_protocol.py @@ -155,10 +155,10 @@ class HTTPFactory(http.HTTPFactory): protocol = HTTPProtocol - def __init__(self, server): + def __init__(self, channel_layer, action_logger=None): http.HTTPFactory.__init__(self) - self.channel_layer = server.channel_layer - self.action_logger = server.action_logger + self.channel_layer = channel_layer + self.action_logger = action_logger # We track all sub-protocols for response channel mapping self.reply_protocols = {} # Make a factory for WebSocket protocols diff --git a/daphne/server.py b/daphne/server.py index 076b652..daff148 100755 --- a/daphne/server.py +++ b/daphne/server.py @@ -14,7 +14,7 @@ class Server(object): self.action_logger = action_logger 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.callInThread(self.backend_reader) reactor.run(installSignalHandlers=self.signal_handlers)