mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
Don't just call self.disconnect in self.reconnect.
It messes up the auto_reconnect value and causes the XML processing loop to spin wildly with errors on a stream disconnect.
This commit is contained in:
parent
2f29d18e53
commit
b8efcc7cf0
1 changed files with 11 additions and 2 deletions
|
@ -530,8 +530,17 @@ class XMLStream(object):
|
||||||
"""
|
"""
|
||||||
Reset the stream's state and reconnect to the server.
|
Reset the stream's state and reconnect to the server.
|
||||||
"""
|
"""
|
||||||
self.disconnect()
|
log.debug("reconnecting...")
|
||||||
self.connect()
|
self.state.transition('connected', 'disconnected', wait=2.0,
|
||||||
|
func=self._disconnect, args=(True,))
|
||||||
|
|
||||||
|
log.debug("connecting...")
|
||||||
|
connected = self.state.transition('disconnected', 'connected',
|
||||||
|
wait=2.0, func=self._connect)
|
||||||
|
while not connected:
|
||||||
|
connected = self.state.transition('disconnected', 'connected',
|
||||||
|
wait=2.0, func=self._connect)
|
||||||
|
return connected
|
||||||
|
|
||||||
def set_socket(self, socket, ignore=False):
|
def set_socket(self, socket, ignore=False):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue