comparison sat/plugins/plugin_xep_0198.py @ 3020:af9d71303605

plugin XEP-0198: don't crash if transport is None in onAckTimeOut
author Goffi <goffi@goffi.org>
date Sun, 21 Jul 2019 10:16:32 +0200
parents c9f03b1eb64d
children ab2696e34d29
comparison
equal deleted inserted replaced
3019:c9f03b1eb64d 3020:af9d71303605
508 self.checkAcks(client) 508 self.checkAcks(client)
509 509
510 def onAckTimeOut(self, client): 510 def onAckTimeOut(self, client):
511 """Called when a requested ACK has not been received in time""" 511 """Called when a requested ACK has not been received in time"""
512 log.info(_(u"Ack was not received in time, aborting connection")) 512 log.info(_(u"Ack was not received in time, aborting connection"))
513 client.xmlstream.transport.abortConnection() 513 transport = client.xmlstream.transport
514 if transport is None:
515 log.warning(u"transport was already removed")
516 else:
517 transport.abortConnection()
514 client._xep_0198_session.req_timer = None 518 client._xep_0198_session.req_timer = None
515 519
516 520
517 class XEP_0198_handler(xmlstream.XMPPHandler): 521 class XEP_0198_handler(xmlstream.XMPPHandler):
518 implements(iwokkel.IDisco) 522 implements(iwokkel.IDisco)