changeset 403:c513328ade9d

plugins XEP-0047 and XEP-0065: timout bug fix
author Goffi <goffi@goffi.org>
date Fri, 07 Oct 2011 12:09:48 +0200
parents f03688bdb858
children 6a1c6c41b91b
files src/plugins/plugin_xep_0047.py src/plugins/plugin_xep_0065.py
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0047.py	Fri Oct 07 11:19:15 2011 +0200
+++ b/src/plugins/plugin_xep_0047.py	Fri Oct 07 12:09:48 2011 +0200
@@ -296,6 +296,9 @@
             self.terminateStream(sid, "IQ_ERROR")
             return
         
+        if data['timer'].active():
+            data['timer'].cancel()
+        
         buffer = data["file_obj"].read(data["block_size"])
         if buffer:
             next_iq_elt = client.IQ(data["xmlstream"],'set')
--- a/src/plugins/plugin_xep_0065.py	Fri Oct 07 11:19:15 2011 +0200
+++ b/src/plugins/plugin_xep_0065.py	Fri Oct 07 12:09:48 2011 +0200
@@ -668,6 +668,7 @@
             self.sendNotAcceptableError(iq_elt['id'], iq_elt['from'], xmlstream)
             return
 
+        self.current_stream[sid]['timer'].cancel()
         self.current_stream[sid]["to"] = jid.JID(iq_elt["to"])
         self.current_stream[sid]["xmlstream"] = xmlstream