Iq.send: set the timeout even when no timeout_callback is set
This commit is contained in:
parent
632b7b4afe
commit
b6b0e82dec
@ -152,7 +152,7 @@ class Iq(RootStanza):
|
|||||||
new_iq['type'] = 'result'
|
new_iq['type'] = 'result'
|
||||||
return new_iq
|
return new_iq
|
||||||
|
|
||||||
def send(self, callback=None, timeout=None, timeout_callback=None, coroutine=False):
|
def send(self, callback=None, timeout=None, timeout_callback=None):
|
||||||
"""Send an <iq> stanza over the XML stream.
|
"""Send an <iq> stanza over the XML stream.
|
||||||
|
|
||||||
A callback handler can be provided that will be executed when the Iq
|
A callback handler can be provided that will be executed when the Iq
|
||||||
@ -193,7 +193,7 @@ class Iq(RootStanza):
|
|||||||
else:
|
else:
|
||||||
future.set_result(result)
|
future.set_result(result)
|
||||||
|
|
||||||
if timeout_callback is not None and timeout is not None:
|
if timeout is not None:
|
||||||
self.stream.cancel_schedule('IqTimeout_%s' % self['id'])
|
self.stream.cancel_schedule('IqTimeout_%s' % self['id'])
|
||||||
if callback is not None:
|
if callback is not None:
|
||||||
callback(result)
|
callback(result)
|
||||||
@ -210,7 +210,7 @@ class Iq(RootStanza):
|
|||||||
constr = CoroutineCallback
|
constr = CoroutineCallback
|
||||||
else:
|
else:
|
||||||
constr = Callback
|
constr = Callback
|
||||||
if timeout_callback is not None and timeout is not None:
|
if timeout is not None:
|
||||||
self.stream.schedule('IqTimeout_%s' % self['id'],
|
self.stream.schedule('IqTimeout_%s' % self['id'],
|
||||||
timeout,
|
timeout,
|
||||||
callback_timeout,
|
callback_timeout,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user