changeset 06bd222f8cc3 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=06bd222f8cc3 description: minor fixes
diffstat:
src/common/jingle_ft.py | 24 ++++++++++-------------- src/common/jingle_ftstates.py | 2 +- src/common/xmpp/protocol.py | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-)
diffs (88 lines):
diff -r fb50d3e9179e -r 06bd222f8cc3 src/common/jingle_ft.py --- a/src/common/jingle_ft.py Wed Apr 04 21:04:23 2012 -0400 +++ b/src/common/jingle_ft.py Sat Apr 07 00:56:44 2012 -0400 @@ -33,17 +33,16 @@
STATE_NOT_STARTED = 0 STATE_INITIALIZED = 1 -STATE_ACCEPTED = 2 # We send the candidates and we are waiting for a reply -STATE_CAND_SENT = 3 +STATE_CAND_SENT = 2 # We received the candidates and we are waiting to reply -STATE_CAND_RECEIVED = 4 +STATE_CAND_RECEIVED = 3 # We have sent and received the candidates # This also includes any candidate-error received or sent -STATE_CAND_SENT_AND_RECEIVED = 5 -STATE_TRANSPORT_REPLACE = 6 +STATE_CAND_SENT_AND_RECEIVED = 4 +STATE_TRANSPORT_REPLACE = 5 # We are transfering the file -STATE_TRANSFERING = 7 +STATE_TRANSFERING = 6
class JingleFileTransfer(JingleContent): @@ -264,11 +263,9 @@ def __transport_setup(self, stanza=None, content=None, error=None, action=None): # Sets up a few transport specific things for the file transfer - # TODO: Do this inside of a state class - if self.transport.type == TransportType.SOCKS5: - self._listen_host()
if self.transport.type == TransportType.IBB: + # No action required, just set the state to transfering self.state = STATE_TRANSFERING
@@ -283,15 +280,14 @@ 'sendCand' : True}
self.nominated_cand['our-cand'] = streamhost - if self.state == STATE_CAND_RECEIVED: - self.__state_changed(STATE_CAND_SENT_AND_RECEIVED, args) - else: - self.__state_changed(STATE_CAND_SENT, args) - + self.__sendCand(args)
def _on_connect_error(self, sid): log.info('connect error, sid=' + sid) args = {'candError' : True} + self.__sendCand(args) + + def __sendCand(self, args): if self.state == STATE_CAND_RECEIVED: self.__state_changed(STATE_CAND_SENT_AND_RECEIVED, args) else: diff -r fb50d3e9179e -r 06bd222f8cc3 src/common/jingle_ftstates.py --- a/src/common/jingle_ftstates.py Wed Apr 04 21:04:23 2012 -0400 +++ b/src/common/jingle_ftstates.py Sat Apr 07 00:56:44 2012 -0400 @@ -37,12 +37,12 @@ '''
def action(self, args=None): + self.jft._listen_host() if self.jft.weinitiate: # update connection's fileprops self.jft.session.connection.files_props[self.jft.file_props['sid']] = \ self.jft.file_props # Listen on configured port for file transfer - self.jft._listen_host() # TODO: Rename this to listen_host() else: # Add file_props to the queue if not gajim.socks5queue.get_file_props( diff -r fb50d3e9179e -r 06bd222f8cc3 src/common/xmpp/protocol.py --- a/src/common/xmpp/protocol.py Wed Apr 04 21:04:23 2012 -0400 +++ b/src/common/xmpp/protocol.py Sat Apr 07 00:56:44 2012 -0400 @@ -90,7 +90,7 @@ NS_JINGLE_RTP = 'urn:xmpp:jingle:apps:rtp:1' # XEP-0167 NS_JINGLE_RTP_AUDIO = 'urn:xmpp:jingle:apps:rtp:audio' # XEP-0167 NS_JINGLE_RTP_VIDEO = 'urn:xmpp:jingle:apps:rtp:video' # XEP-0167 -NS_JINGLE_FILE_TRANSFER ='urn:xmpp:jingle:apps:file-transfer:1' # XEP-0234 +NS_JINGLE_FILE_TRANSFER ='urn:xmpp:jingle:apps:file-transfer:3' # XEP-0234 NS_JINGLE_XTLS='urn:xmpp:jingle:security:xtls:0' # XTLS: EXPERIMENTAL security layer of jingle NS_JINGLE_RAW_UDP = 'urn:xmpp:jingle:transports:raw-udp:1' # XEP-0177 NS_JINGLE_ICE_UDP = 'urn:xmpp:jingle:transports:ice-udp:1' # XEP-0176