Commit 11dcf387 authored by Philipp Hörist's avatar Philipp Hörist

Dont plug out NonBlockingBind before its finished

parent 483a893c
Pipeline #2745 passed with stages
in 19 seconds
......@@ -631,7 +631,6 @@ class NonBlockingBind(PlugIn):
iq = Protocol('iq', typ='set', payload=[node])
self._owner.SendAndWaitForResponse(
iq, func=self._on_session)
self.PlugOut()
return
if resp:
log.error('Binding failed: %s.', resp.getTag('error'))
......@@ -649,10 +648,11 @@ class NonBlockingBind(PlugIn):
log.error('Session open failed')
self._owner.Connection.start_disconnect()
self._owner.Dispatcher.Event(Realm.CONNECTING, Event.SESSION_FAILED)
self.PlugOut()
self.PlugOut()
def _on_bind_successful(self):
feats = self._owner.Dispatcher.Stream.features
if feats.getTag('sm', namespace=NS_STREAM_MGMT):
self._owner.Smacks.send_enable()
self._owner.Dispatcher.Event(Realm.CONNECTING, Event.CONNECTION_ACTIVE)
self.PlugOut()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment