Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-08-14 14:34:55 +0300
committerlovetox <philipp@hoerist.com>2020-08-15 09:42:45 +0300
commit80f36a8438bec6b7dab913978efa43223bc0a528 (patch)
tree2e15132e80045a2f5ee04151bca2950a2c317875
parentc0b512fe91cbdceae2f31408b19e7a4173bc572e (diff)
TCP: Set input/output closed on finalize()
Hopefully Fixes #108
-rw-r--r--nbxmpp/tcp.py2
-rw-r--r--nbxmpp/websocket.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/nbxmpp/tcp.py b/nbxmpp/tcp.py
index 7c6b6b7..e661a8c 100644
--- a/nbxmpp/tcp.py
+++ b/nbxmpp/tcp.py
@@ -365,6 +365,8 @@ class TCPConnection(Connection):
self._con.get_socket().shutdown(True, True)
except GLib.Error as error:
self._log.info(error)
+ self._input_closed = True
+ self._output_closed = True
self.state = TCPState.DISCONNECTED
self.notify(signal_name)
self.destroy()
diff --git a/nbxmpp/websocket.py b/nbxmpp/websocket.py
index 82b72eb..9459e12 100644
--- a/nbxmpp/websocket.py
+++ b/nbxmpp/websocket.py
@@ -169,6 +169,8 @@ class WebsocketConnection(Connection):
self._output_closed = True
def _finalize(self, signal_name):
+ self._input_closed = True
+ self._output_closed = True
self.state = TCPState.DISCONNECTED
self.notify(signal_name)
self.destroy()