comparison sat/plugins/plugin_xep_0198.py @ 2865:9213c6dff48d

plugin XEP-0198: reset req_timer on session.reset(): req_timer may not have been called when session.reset() is called (e.g. on resuming failed after computer has been suspended), so reset() must cancel it and set its value to None.
author Goffi <goffi@goffi.org>
date Thu, 21 Mar 2019 08:54:59 +0100
parents fdc53c8a5439
children c8c68a3b0a79
comparison
equal deleted inserted replaced
2864:33a69ee7fbb7 2865:9213c6dff48d
114 self.buffer_idx = 0 114 self.buffer_idx = 0
115 self.in_counter = self.out_counter = 0 115 self.in_counter = self.out_counter = 0
116 self.session_id = self.location = None 116 self.session_id = self.location = None
117 self.ack_requested = False 117 self.ack_requested = False
118 self.last_ack_r = 0 118 self.last_ack_r = 0
119 if self.req_timer is not None:
120 if self.req_timer.active():
121 log.error(u"req_timer has been called/cancelled but not reset")
122 else:
123 self.req_timer.cancel()
124 self.req_timer = None
119 125
120 126
121 class XEP_0198(object): 127 class XEP_0198(object):
122 # FIXME: location is not handled yet 128 # FIXME: location is not handled yet
123 129