plugins XEP-0234, XEP-0260, XEP-0261: jingle session termination is managed by application (XEP-0234) instead of transport

This commit is contained in:
Goffi 2015-11-08 14:48:04 +01:00
commit af953d89a9

View file

@ -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)