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.
This commit is contained in:
Emmanuel Gil Peyrot 2019-01-09 13:22:37 +01:00
parent d228bc42ea
commit 5f25b0b6a0

View file

@ -187,6 +187,10 @@ class Iq(RootStanza):
future = asyncio.Future() future = asyncio.Future()
# Prevents handlers from existing forever.
if timeout is None:
timeout = 120
def callback_success(result): def callback_success(result):
type_ = result['type'] type_ = result['type']
if type_ == 'result': if type_ == 'result':