Prevent auto_reconnect interference when disconnecting.
This commit is contained in:
parent
2324c90232
commit
80a90a6221
1 changed files with 3 additions and 1 deletions
|
@ -692,11 +692,13 @@ class XMLStream(object):
|
||||||
if send_close:
|
if send_close:
|
||||||
self.send_raw(self.stream_footer, now=True)
|
self.send_raw(self.stream_footer, now=True)
|
||||||
|
|
||||||
|
if not reconnect:
|
||||||
|
self.auto_reconnect = False
|
||||||
|
|
||||||
# Wait for confirmation that the stream was
|
# Wait for confirmation that the stream was
|
||||||
# closed in the other direction. If we didn't
|
# closed in the other direction. If we didn't
|
||||||
# send a stream footer we don't need to wait
|
# send a stream footer we don't need to wait
|
||||||
# since the server won't know to respond.
|
# since the server won't know to respond.
|
||||||
self.auto_reconnect = reconnect
|
|
||||||
if send_close:
|
if send_close:
|
||||||
log.info('Waiting for %s from server', self.stream_footer)
|
log.info('Waiting for %s from server', self.stream_footer)
|
||||||
self.stream_end_event.wait(4)
|
self.stream_end_event.wait(4)
|
||||||
|
|
Loading…
Reference in a new issue