From 5f25b0b6a020c1a368b3d0c9766887c4c95205a9 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 9 Jan 2019 13:22:37 +0100 Subject: Add a default timeout to iq.send(). This fixes a leak of MatchIDSender in handlers, making it more and more expensive to match stanzas as more iqs have been sent. --- slixmpp/stanza/iq.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/slixmpp/stanza/iq.py b/slixmpp/stanza/iq.py index 385bbbd9..a3f16e2f 100644 --- a/slixmpp/stanza/iq.py +++ b/slixmpp/stanza/iq.py @@ -187,6 +187,10 @@ class Iq(RootStanza): future = asyncio.Future() + # Prevents handlers from existing forever. + if timeout is None: + timeout = 120 + def callback_success(result): type_ = result['type'] if type_ == 'result': -- cgit v1.2.3