changeset 87aff98e45e5 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: gajim_0.16 details:http://hg.gajim.org/gajim?cmd=changeset;node=87aff98e45e5 description: fix sending candidates and computing hash in jingle file transfer. Fixes #7669
diffstat:
src/common/jingle_ft.py | 5 +++-- src/common/jingle_transport.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
diffs (39 lines):
diff -r ebdd75803280 -r 87aff98e45e5 src/common/jingle_ft.py --- a/src/common/jingle_ft.py Thu Apr 24 22:08:01 2014 +0200 +++ b/src/common/jingle_ft.py Fri Apr 25 12:48:39 2014 +0200 @@ -110,7 +110,7 @@ STATE_TRANSPORT_REPLACE : StateTransportReplace(self), STATE_CAND_SENT_AND_RECEIVED : StateCandSentAndRecv(self) } - + if jingle_xtls.PYOPENSSL_PRESENT: cert_name = os.path.join(configpaths.gajimpaths['MY_CERT'], jingle_xtls.SELF_SIGNED_CERTIFICATE) @@ -160,12 +160,13 @@ if self.file_props.algo == None: return try: - file_ = open(self.file_props.file_name, 'r') + file_ = open(self.file_props.file_name, 'rb') except: # can't open file return h = nbxmpp.Hashes() hash_ = h.calculateHash(self.file_props.algo, file_) + file_.close() # DEBUG #hash_ = '1294809248109223' if not hash_: diff -r ebdd75803280 -r 87aff98e45e5 src/common/jingle_transport.py --- a/src/common/jingle_transport.py Thu Apr 24 22:08:01 2014 +0200 +++ b/src/common/jingle_transport.py Fri Apr 25 12:48:39 2014 +0200 @@ -69,7 +69,7 @@ candidates is None) """ if not candidates: - candidates = self._iter_candidates() + candidates = list(self._iter_candidates()) else: candidates = (self.make_candidate(candidate) for candidate in candidates) transport = nbxmpp.Node('transport', payload=candidates)