diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2019-01-09 13:22:37 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2019-01-09 14:20:31 +0100 |
commit | 5f25b0b6a020c1a368b3d0c9766887c4c95205a9 (patch) | |
tree | 232afd8822f8c08d5ee3a790254f5b678563d801 | |
parent | d228bc42ea598498131f4ae8cef6eaf45ef71107 (diff) | |
download | slixmpp-5f25b0b6a020c1a368b3d0c9766887c4c95205a9.tar.gz slixmpp-5f25b0b6a020c1a368b3d0c9766887c4c95205a9.tar.bz2 slixmpp-5f25b0b6a020c1a368b3d0c9766887c4c95205a9.tar.xz slixmpp-5f25b0b6a020c1a368b3d0c9766887c4c95205a9.zip |
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.
-rw-r--r-- | slixmpp/stanza/iq.py | 4 |
1 files changed, 4 insertions, 0 deletions
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': |