clear _expected dict when callback is called. This way when another stanza arrives with the same id, it isn't catched as expected.
This commit is contained in:
parent
0349c4ad23
commit
d3417371c0
|
@ -349,6 +349,7 @@ class Dispatcher(PlugIn):
|
||||||
if self._expected[self._witid] is None:
|
if self._expected[self._witid] is None:
|
||||||
return
|
return
|
||||||
if self.on_responses.has_key(self._witid):
|
if self.on_responses.has_key(self._witid):
|
||||||
|
i = self._witid # copy id cause it can change in resp() call
|
||||||
self._owner.onreceive(None)
|
self._owner.onreceive(None)
|
||||||
resp, args = self.on_responses[self._witid]
|
resp, args = self.on_responses[self._witid]
|
||||||
del(self.on_responses[self._witid])
|
del(self.on_responses[self._witid])
|
||||||
|
@ -356,6 +357,7 @@ class Dispatcher(PlugIn):
|
||||||
resp(self._expected[self._witid])
|
resp(self._expected[self._witid])
|
||||||
else:
|
else:
|
||||||
resp(self._owner, self._expected[self._witid], **args)
|
resp(self._owner, self._expected[self._witid], **args)
|
||||||
|
del self._expected[i]
|
||||||
|
|
||||||
def SendAndWaitForResponse(self, stanza, timeout=None, func=None, args=None):
|
def SendAndWaitForResponse(self, stanza, timeout=None, func=None, args=None):
|
||||||
''' Put stanza on the wire and wait for recipient's response to it. '''
|
''' Put stanza on the wire and wait for recipient's response to it. '''
|
||||||
|
|
Loading…
Reference in New Issue