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:
parent
d228bc42ea
commit
5f25b0b6a0
1 changed files with 4 additions and 0 deletions
|
@ -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':
|
||||||
|
|
Loading…
Reference in a new issue