changeset ef8964b0afc2 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: details:http://hg.gajim.org/gajim?cmd=changeset;node=ef8964b0afc2 description: fix sending file over XTLS encrypted socket
diffstat:
src/common/jingle_ft.py | 1 + src/common/socks5.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletions(-)
diffs (76 lines):
diff -r d9e620e58654 -r ef8964b0afc2 src/common/jingle_ft.py --- a/src/common/jingle_ft.py Sat Apr 02 17:10:35 2016 +0200 +++ b/src/common/jingle_ft.py Sun Apr 03 14:28:08 2016 +0200 @@ -128,6 +128,7 @@ self.state = nextstate
def __on_session_initiate(self, stanza, content, error, action): + log.debug("Jingle FT request received") gajim.nec.push_incoming_event(FileRequestReceivedEvent(None, conn=self.session.connection, stanza=stanza, jingle_content=content, FT_content=self)) diff -r d9e620e58654 -r ef8964b0afc2 src/common/socks5.py --- a/src/common/socks5.py Sat Apr 02 17:10:35 2016 +0200 +++ b/src/common/socks5.py Sun Apr 03 14:28:08 2016 +0200 @@ -82,6 +82,7 @@ Start waiting for incomming connections on (host, port) and do a socks5 authentication using sid for generated SHA """ + log.debug('Start listening for socks5 connection') sid = file_props.sid self.sha_handlers[sha_str] = (sha_handler, sid) if self.listener is None or self.listener.connections == []: @@ -131,11 +132,13 @@ else: fp = fingerprint if receiving: + log.debug('Trying to connect as receiver to cid ' + streamhost['cid']) 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 file_props.sha_str: idx = file_props.sha_str else: @@ -162,6 +165,7 @@ 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']) for host in file_props.streamhosts: if host != streamhost and 'idx' in host: if host['state'] == 1: @@ -223,6 +227,7 @@ """ Called when we loose connection during transfer """ + log.debug('Connection refused to cid ' + streamhost['cid']) if file_props is None: return streamhost['state'] = -1 @@ -540,6 +545,7 @@ return 1 # we are connected
def read_timeout(self): + print('read_timeout') self.idlequeue.remove_timeout(self.fd) if self.state > 5: # no activity for foo seconds @@ -649,7 +655,6 @@ def write_next(self): if self.remaining_buff != b'': buff = self.remaining_buff - self.remaining_buff = b'' else: try: self.open_file_for_reading() @@ -743,6 +748,7 @@ raise e except Exception: buff = b'' + print('received ' + str(len(buff))) current_time = self.idlequeue.current_time() self.file_props.elapsed_time += current_time - \ self.file_props.last_time