Skip to content
Snippets Groups Projects
Commit cc198ec3 authored by zimio's avatar zimio
Browse files

Also cancel the jingle session when initiator for IBB transfer cancellation

parent 5b97ef27
No related branches found
No related tags found
No related merge requests found
......@@ -135,6 +135,7 @@ class FileProp(object):
self.hash_ = None
self.fd = None
self.startexmpp = None
# Type of the session, if it is 'jingle' or 'si'
self.session_type = None
self.request_id = None
self.proxyhosts = None
......
......@@ -811,6 +811,14 @@ class ConnectionIBBytestream(ConnectionBytestream):
file_props.direction[1:], 'set',
payload=[nbxmpp.Node(nbxmpp.NS_IBB + ' close',
{'sid':file_props.sid})]))
if file_props.session_type == 'jingle':
peerjid = \
file_props.receiver if file_props.type_ == 's' else file_props.sender
session = self.get_jingle_session(peerjid, file_props.sid, 'file')
# According to the xep, the initiator also cancels the jingle session
# if there are no more files to send using IBB
if session.weinitiate:
session.cancel_session()
def OpenStream(self, sid, to, fp, blocksize=4096):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment