plugins XEP-0234, XEP-0260, XEP-0261: jingle session termination is managed by application (XEP-0234) instead of transport
This commit is contained in:
parent
728e15c90c
commit
af953d89a9
1 changed files with 51 additions and 33 deletions
|
|
@ -77,24 +77,17 @@ class XEP_0261(object):
|
|||
peer_jid = session['peer_jid']
|
||||
sid = transport_data['sid']
|
||||
file_obj = content_data['file_obj']
|
||||
args = [session, content_name, profile]
|
||||
if action == self._j.A_START:
|
||||
block_size = transport_data['block_size']
|
||||
d = self._ibb.startStream(file_obj, peer_jid, sid, block_size, profile)
|
||||
d.addErrback(self._streamEb, *args)
|
||||
d.chainDeferred(content_data['finished_d'])
|
||||
else:
|
||||
d = self._ibb.createSession(file_obj, peer_jid, sid, profile)
|
||||
d.addCallbacks(self._streamCb, self._streamEb, args, None, args)
|
||||
d.chainDeferred(content_data['finished_d'])
|
||||
else:
|
||||
log.warning(u"FIXME: unmanaged action {}".format(action))
|
||||
return transport_elt
|
||||
|
||||
def _streamCb(self, dummy, session, content_name, profile):
|
||||
self._j.contentTerminate(session, content_name, profile=profile)
|
||||
|
||||
def _streamEb(self, failure, session, content_name, profile):
|
||||
log.warning(u"Error while streaming in-band: {}".format(failure))
|
||||
self._j.contentTerminate(session, content_name, reason=self._j.REASON_FAILED_TRANSPORT, profile=profile)
|
||||
|
||||
class XEP_0261_handler(XMPPHandler):
|
||||
implements(iwokkel.IDisco)
|
||||
|
|
|
|||
Loading…
Reference in a new issue