Yann Leboulanger pushed to branch master at gajim / gajim
Commits: 43b3d1bd by Yann Leboulanger at 2017-08-12T22:55:17+02:00 unify cid -> candidate_id - - - - - 3 changed files: - gajim/common/jingle_ftstates.py - gajim/common/jingle_transport.py - gajim/common/socks5.py Changes: ===================================== gajim/common/jingle_ftstates.py ===================================== --- a/gajim/common/jingle_ftstates.py +++ b/gajim/common/jingle_ftstates.py @@ -79,7 +79,7 @@ class StateCandSent(JingleFileTransferStates): transport.setNamespace(nbxmpp.NS_JINGLE_BYTESTREAM) transport.setAttr('sid', self.jft.transport.sid) candidateused = nbxmpp.Node('candidate-used') - candidateused.setAttr('cid', streamhost['cid']) + candidateused.setAttr('cid', streamhost['candidate_id']) transport.addChild(node=candidateused) content.addChild(node=transport) self.jft.session.send_transport_info(content) ===================================== gajim/common/jingle_transport.py ===================================== --- a/gajim/common/jingle_transport.py +++ b/gajim/common/jingle_transport.py @@ -156,7 +156,7 @@ class JingleTransportSocks5(JingleTransport): 'target': self.ourjid, 'host': candidate['host'], 'port': int(candidate['port']), - 'cid': candidate['cid'], + 'candidate_id': candidate['cid'], 'type': typ, 'priority': candidate['priority'] } ===================================== gajim/common/socks5.py ===================================== --- a/gajim/common/socks5.py +++ b/gajim/common/socks5.py @@ -133,13 +133,23 @@ class SocksQueue: else: fp = fingerprint if receiving: - log.debug('Trying to connect as receiver to cid ' + streamhost['cid']) + if 'candidate_id' in streamhost: + log.debug('Trying to connect as receiver to cid ' + \ + streamhost['candidate_id']) + else: + log.debug('Trying to connect as receiver to jid ' + \ + streamhost['jid']) file_props.type_ = 'r' socks5obj = Socks5ReceiverClient(self.idlequeue, streamhost, sid, file_props, fingerprint=fp) self.add_sockobj(account, socks5obj) else: - log.debug('Trying to connect as sender to cid' + streamhost['cid']) + if 'candidate_id' in streamhost: + log.debug('Trying to connect as sender to cid' + \ + streamhost['candidate_id']) + else: + log.debug('Trying to connect as sender to jid' + \ + streamhost['jid']) if file_props.sha_str: idx = file_props.sha_str else: @@ -166,7 +176,10 @@ class SocksQueue: Called when there is a host connected to one of the senders's streamhosts. Stop other attempts for connections """ - log.debug('Connected to cid ' + streamhost['cid']) + if 'candidate_id' in streamhost: + log.debug('Connected to cid ' + streamhost['candidate_id']) + else: + log.debug('Connected to jid ' + streamhost['jid']) for host in file_props.streamhosts: if host != streamhost and 'idx' in host: if host['state'] == 1: @@ -228,7 +241,10 @@ class SocksQueue: """ Called when we loose connection during transfer """ - log.debug('Connection refused to cid ' + streamhost['cid']) + if 'candidate_id' in streamhost: + log.debug('Connection refused to cid ' + streamhost['candidate_id']) + else: + log.debug('Connection refused to jid ' + streamhost['jid']) if file_props is None: return streamhost['state'] = -1 View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/43b3d1bd83538d3fe222c42d40295176da16c0ff --- View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/43b3d1bd83538d3fe222c42d40295176da16c0ff You're receiving this email because of your account on dev.gajim.org.
_______________________________________________ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits