From d3417371c0c1cf40149ee86c161aebf68ffbff03 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 5 Mar 2006 20:30:38 +0000 Subject: [PATCH] clear _expected dict when callback is called. This way when another stanza arrives with the same id, it isn't catched as expected. --- src/common/xmpp/dispatcher_nb.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/xmpp/dispatcher_nb.py b/src/common/xmpp/dispatcher_nb.py index 70f2cf668..559b25602 100644 --- a/src/common/xmpp/dispatcher_nb.py +++ b/src/common/xmpp/dispatcher_nb.py @@ -349,6 +349,7 @@ class Dispatcher(PlugIn): if self._expected[self._witid] is None: return if self.on_responses.has_key(self._witid): + i = self._witid # copy id cause it can change in resp() call self._owner.onreceive(None) resp, args = self.on_responses[self._witid] del(self.on_responses[self._witid]) @@ -356,6 +357,7 @@ class Dispatcher(PlugIn): resp(self._expected[self._witid]) else: resp(self._owner, self._expected[self._witid], **args) + del self._expected[i] def SendAndWaitForResponse(self, stanza, timeout=None, func=None, args=None): ''' Put stanza on the wire and wait for recipient's response to it. '''