Check previous handler did not close the transport

This commit is contained in:
Ben 2020-04-23 21:49:01 +01:00
parent 1d89531634
commit f2e9abb148

View File

@ -99,7 +99,8 @@ class Spheniscidae:
packet_data = parsed_data[4:] packet_data = parsed_data[4:]
for listener in xt_listeners: 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) await listener(self, packet_data)
self.received_packets.add(packet) self.received_packets.add(packet)
else: else:
@ -125,7 +126,8 @@ class Spheniscidae:
xml_listeners = self.server.xml_listeners[packet] xml_listeners = self.server.xml_listeners[packet]
for listener in xml_listeners: 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) await listener(self, body_tag)
self.received_packets.add(packet) self.received_packets.add(packet)