diff options
author | Lance Stout <lancestout@gmail.com> | 2012-06-01 13:50:38 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-06-01 13:50:38 -0700 |
commit | 387ef513d6259e268976270ac2c658dcb3cc7823 (patch) | |
tree | 93b23814a128c53661b59182ca83fc30c0c303ac /sleekxmpp/xmlstream/xmlstream.py | |
parent | 2858dbf57f0577345d4962d70f0872bdd85511c4 (diff) | |
download | slixmpp-387ef513d6259e268976270ac2c658dcb3cc7823.tar.gz slixmpp-387ef513d6259e268976270ac2c658dcb3cc7823.tar.bz2 slixmpp-387ef513d6259e268976270ac2c658dcb3cc7823.tar.xz slixmpp-387ef513d6259e268976270ac2c658dcb3cc7823.zip |
Check that the session is still alive before sending data.
Fixes issue #168
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 30bbaa5e..babe2f54 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -1612,7 +1612,8 @@ class XMLStream(object): tries = 0 try: with self.send_lock: - while sent < total and not self.stop.is_set(): + while sent < total and not self.stop.is_set() and + self.session_started_event.is_set(): try: sent += self.socket.send(enc_data[sent:]) count += 1 |