From f2e9abb148ab3bde3457572d8e6ccdc29da08563 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 23 Apr 2020 21:49:01 +0100 Subject: [PATCH] Check previous handler did not close the transport --- houdini/spheniscidae.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/houdini/spheniscidae.py b/houdini/spheniscidae.py index 0c8f7e1..de80e7c 100644 --- a/houdini/spheniscidae.py +++ b/houdini/spheniscidae.py @@ -99,7 +99,8 @@ class Spheniscidae: packet_data = parsed_data[4:] for listener in xt_listeners: - if listener.client_type is None or listener.client_type == self.client_type: + if not self.__writer.is_closing() and listener.client_type is None \ + or listener.client_type == self.client_type: await listener(self, packet_data) self.received_packets.add(packet) else: @@ -125,7 +126,8 @@ class Spheniscidae: xml_listeners = self.server.xml_listeners[packet] for listener in xml_listeners: - if listener.client_type is None or listener.client_type == self.client_type: + if not self.__writer.is_closing() and listener.client_type is None \ + or listener.client_type == self.client_type: await listener(self, body_tag) self.received_packets.add(packet)