summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-04-18 21:16:03 +0200
committermathieui <mathieui@mathieui.net>2021-04-18 21:16:03 +0200
commitd4e1b68534203f5da1d1adbfb4b5cd2efa6694a8 (patch)
tree0e4eda93d486e80ff1a0c3a369514f8da93eab14
parent3bb01de1201501d759c6aadb08ecd9ccf0bdc47c (diff)
downloadslixmpp-d4e1b68534203f5da1d1adbfb4b5cd2efa6694a8.tar.gz
slixmpp-d4e1b68534203f5da1d1adbfb4b5cd2efa6694a8.tar.bz2
slixmpp-d4e1b68534203f5da1d1adbfb4b5cd2efa6694a8.tar.xz
slixmpp-d4e1b68534203f5da1d1adbfb4b5cd2efa6694a8.zip
Allow handshake in stream.send() when not connected yet
fix #3464
-rw-r--r--slixmpp/xmlstream/xmlstream.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/slixmpp/xmlstream/xmlstream.py b/slixmpp/xmlstream/xmlstream.py
index 9fd21c58..4cb51b94 100644
--- a/slixmpp/xmlstream/xmlstream.py
+++ b/slixmpp/xmlstream/xmlstream.py
@@ -1140,9 +1140,12 @@ class XMLStream(asyncio.BaseProtocol):
if not self._always_send_everything and not self._session_started:
# Avoid circular imports
from slixmpp.stanza.rootstanza import RootStanza
- from slixmpp.stanza import Iq
- is_bind = isinstance(data, Iq) and data.get_plugin('bind', check=True)
- if isinstance(data, (RootStanza, str)) and not is_bind:
+ from slixmpp.stanza import Iq, Handshake
+ passthrough = (
+ (isinstance(data, Iq) and data.get_plugin('bind', check=True))
+ or isinstance(data, Handshake)
+ )
+ if isinstance(data, (RootStanza, str)) and not passthrough:
self.__queued_stanzas.append(data)
log.debug('NOT SENT: %s %s', type(data), data)
return