coding standards + choose correct streamhost when we receive the streamhost_used after we sent it
This commit is contained in:
parent
a3d772e505
commit
e49a48d7da
1 changed files with 42 additions and 41 deletions
|
@ -192,7 +192,7 @@ class JingleFileTransfer(JingleContent):
|
||||||
if self.state == STATE_CAND_SENT_PENDING_REPLY:
|
if self.state == STATE_CAND_SENT_PENDING_REPLY:
|
||||||
response = stanza.buildReply('result')
|
response = stanza.buildReply('result')
|
||||||
self.session.connection.connection.send(response)
|
self.session.connection.connection.send(response)
|
||||||
self.start_transfer(streamhost_used)
|
self.start_transfer()
|
||||||
raise xmpp.NodeProcessed
|
raise xmpp.NodeProcessed
|
||||||
else:
|
else:
|
||||||
self.state = STATE_CAND_RECEIVED_PENDING_REPLY
|
self.state = STATE_CAND_RECEIVED_PENDING_REPLY
|
||||||
|
@ -230,7 +230,6 @@ class JingleFileTransfer(JingleContent):
|
||||||
# proxy activated
|
# proxy activated
|
||||||
self.state = STATE_PROXY_ACTIVATED
|
self.state = STATE_PROXY_ACTIVATED
|
||||||
elif self.state == STATE_CAND_SENT_AND_RECEIVED:
|
elif self.state == STATE_CAND_SENT_AND_RECEIVED:
|
||||||
|
|
||||||
if not self.nominated_cand['our-cand'] and \
|
if not self.nominated_cand['our-cand'] and \
|
||||||
not self.nominated_cand['peer-cand']:
|
not self.nominated_cand['peer-cand']:
|
||||||
if not self.weinitiate:
|
if not self.weinitiate:
|
||||||
|
@ -238,7 +237,7 @@ class JingleFileTransfer(JingleContent):
|
||||||
self.session.transport_replace()
|
self.session.transport_replace()
|
||||||
return
|
return
|
||||||
# initiate transfer
|
# initiate transfer
|
||||||
self.start_transfer(None)
|
self.start_transfer()
|
||||||
|
|
||||||
def send_candidate_used(self, streamhost):
|
def send_candidate_used(self, streamhost):
|
||||||
"""
|
"""
|
||||||
|
@ -361,7 +360,7 @@ class JingleFileTransfer(JingleContent):
|
||||||
return self.weinitiate
|
return self.weinitiate
|
||||||
|
|
||||||
|
|
||||||
def start_transfer(self, streamhost_used):
|
def start_transfer(self):
|
||||||
|
|
||||||
self.state = STATE_TRANSFERING
|
self.state = STATE_TRANSFERING
|
||||||
|
|
||||||
|
@ -370,8 +369,10 @@ class JingleFileTransfer(JingleContent):
|
||||||
|
|
||||||
if self.isOurCandUsed():
|
if self.isOurCandUsed():
|
||||||
type = 'client'
|
type = 'client'
|
||||||
|
streamhost_used = self.nominated_cand['our-cand']
|
||||||
else:
|
else:
|
||||||
type = 'server'
|
type = 'server'
|
||||||
|
streamhost_used = self.nominated_cand['peer-cand']
|
||||||
|
|
||||||
# FIXME if streamhost_used is none where do we get the proxy host
|
# FIXME if streamhost_used is none where do we get the proxy host
|
||||||
if streamhost_used and streamhost_used['type'] == 'proxy':
|
if streamhost_used and streamhost_used['type'] == 'proxy':
|
||||||
|
|
Loading…
Add table
Reference in a new issue