Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gajim
python-nbxmpp
Commits
c04b5fbf
Commit
c04b5fbf
authored
Nov 29, 2012
by
Yann Leboulanger
Browse files
handle disconnection while doing SASL as a sasl failure rather than a connection error.
parent
29f26e3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
nbxmpp/client_nb.py
View file @
c04b5fbf
...
...
@@ -85,6 +85,7 @@ class NonBlockingClient:
log
.
info
(
'Disconnecting NBClient: %s'
%
message
)
sasl_failed
=
False
if
'NonBlockingRoster'
in
self
.
__dict__
:
self
.
NonBlockingRoster
.
PlugOut
()
if
'NonBlockingBind'
in
self
.
__dict__
:
...
...
@@ -92,7 +93,12 @@ class NonBlockingClient:
if
'NonBlockingNonSASL'
in
self
.
__dict__
:
self
.
NonBlockingNonSASL
.
PlugOut
()
if
'SASL'
in
self
.
__dict__
:
self
.
SASL
.
PlugOut
()
if
self
.
SASL
.
startsasl
==
'failure-in-process'
:
sasl_failed
=
True
self
.
SASL
.
startsasl
=
'failure'
self
.
_on_start_sasl
()
else
:
self
.
SASL
.
PlugOut
()
if
'NonBlockingTCP'
in
self
.
__dict__
:
self
.
NonBlockingTCP
.
PlugOut
()
if
'NonBlockingHTTP'
in
self
.
__dict__
:
...
...
@@ -111,7 +117,9 @@ class NonBlockingClient:
self
.
disconnecting
=
True
log
.
debug
(
'Client disconnected..'
)
if
connected
==
''
:
# Don't call any callback when it's a SASL failure.
# SASL handler is already called
if
connected
==
''
and
not
sasl_failed
:
# if we're disconnecting before connection to XMPP sever is opened,
# we don't call disconnect handlers but on_connect_failure callback
if
self
.
proxy
:
...
...
@@ -121,7 +129,7 @@ class NonBlockingClient:
else
:
log
.
debug
(
'calling on_connect_failure cb'
)
self
.
on_connect_failure
()
el
se
:
el
if
not
sasl_failed
:
# we are connected to XMPP server
if
not
stream_started
:
# if error occur before XML stream was opened, e.g. no response on
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment