fix bug in ServerProtocol

This commit is contained in:
Kay Kurokawa 2016-12-28 14:34:38 -05:00
parent d1ccac1b04
commit 7d5dd1ff51

View file

@ -33,8 +33,7 @@ class ServerProtocol(Protocol):
peer_info = self.transport.getPeer() peer_info = self.transport.getPeer()
self.peer = self.factory.peer_manager.get_peer(peer_info.host, peer_info.port) self.peer = self.factory.peer_manager.get_peer(peer_info.host, peer_info.port)
self.request_handler = ServerRequestHandler(self) self.request_handler = ServerRequestHandler(self)
for query_handler_factory, enabled in self.factory.query_handler_factories.iteritems(): for query_handler_factory in self.factory.query_handler_factories.values():
if enabled is True:
query_handler = query_handler_factory.build_query_handler() query_handler = query_handler_factory.build_query_handler()
query_handler.register_with_request_handler(self.request_handler, self.peer) query_handler.register_with_request_handler(self.request_handler, self.peer)
log.debug("Setting the request handler") log.debug("Setting the request handler")