Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
038ea0fe
Commit
038ea0fe
authored
12 years ago
by
zimio
Browse files
Options
Downloads
Patches
Plain Diff
minor fixes
parent
026e5b44
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/jingle_ft.py
+10
-14
10 additions, 14 deletions
src/common/jingle_ft.py
src/common/jingle_ftstates.py
+1
-1
1 addition, 1 deletion
src/common/jingle_ftstates.py
src/common/xmpp/protocol.py
+1
-1
1 addition, 1 deletion
src/common/xmpp/protocol.py
with
12 additions
and
16 deletions
src/common/jingle_ft.py
+
10
−
14
View file @
038ea0fe
...
@@ -33,17 +33,16 @@ log = logging.getLogger('gajim.c.jingle_ft')
...
@@ -33,17 +33,16 @@ log = logging.getLogger('gajim.c.jingle_ft')
STATE_NOT_STARTED
=
0
STATE_NOT_STARTED
=
0
STATE_INITIALIZED
=
1
STATE_INITIALIZED
=
1
STATE_ACCEPTED
=
2
# We send the candidates and we are waiting for a reply
# 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
# 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
# We have sent and received the candidates
# This also includes any candidate-error received or sent
# This also includes any candidate-error received or sent
STATE_CAND_SENT_AND_RECEIVED
=
5
STATE_CAND_SENT_AND_RECEIVED
=
4
STATE_TRANSPORT_REPLACE
=
6
STATE_TRANSPORT_REPLACE
=
5
# We are transfering the file
# We are transfering the file
STATE_TRANSFERING
=
7
STATE_TRANSFERING
=
6
class
JingleFileTransfer
(
JingleContent
):
class
JingleFileTransfer
(
JingleContent
):
...
@@ -264,11 +263,9 @@ class JingleFileTransfer(JingleContent):
...
@@ -264,11 +263,9 @@ class JingleFileTransfer(JingleContent):
def
__transport_setup
(
self
,
stanza
=
None
,
content
=
None
,
error
=
None
,
def
__transport_setup
(
self
,
stanza
=
None
,
content
=
None
,
error
=
None
,
action
=
None
):
action
=
None
):
# Sets up a few transport specific things for the file transfer
# 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
:
if
self
.
transport
.
type
==
TransportType
.
IBB
:
# No action required, just set the state to transfering
self
.
state
=
STATE_TRANSFERING
self
.
state
=
STATE_TRANSFERING
...
@@ -283,15 +280,14 @@ class JingleFileTransfer(JingleContent):
...
@@ -283,15 +280,14 @@ class JingleFileTransfer(JingleContent):
'
sendCand
'
:
True
}
'
sendCand
'
:
True
}
self
.
nominated_cand
[
'
our-cand
'
]
=
streamhost
self
.
nominated_cand
[
'
our-cand
'
]
=
streamhost
if
self
.
state
==
STATE_CAND_RECEIVED
:
self
.
__sendCand
(
args
)
self
.
__state_changed
(
STATE_CAND_SENT_AND_RECEIVED
,
args
)
else
:
self
.
__state_changed
(
STATE_CAND_SENT
,
args
)
def
_on_connect_error
(
self
,
sid
):
def
_on_connect_error
(
self
,
sid
):
log
.
info
(
'
connect error, sid=
'
+
sid
)
log
.
info
(
'
connect error, sid=
'
+
sid
)
args
=
{
'
candError
'
:
True
}
args
=
{
'
candError
'
:
True
}
self
.
__sendCand
(
args
)
def
__sendCand
(
self
,
args
):
if
self
.
state
==
STATE_CAND_RECEIVED
:
if
self
.
state
==
STATE_CAND_RECEIVED
:
self
.
__state_changed
(
STATE_CAND_SENT_AND_RECEIVED
,
args
)
self
.
__state_changed
(
STATE_CAND_SENT_AND_RECEIVED
,
args
)
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
src/common/jingle_ftstates.py
+
1
−
1
View file @
038ea0fe
...
@@ -37,12 +37,12 @@ class StateInitialized(JingleFileTransferStates):
...
@@ -37,12 +37,12 @@ class StateInitialized(JingleFileTransferStates):
'''
'''
def
action
(
self
,
args
=
None
):
def
action
(
self
,
args
=
None
):
self
.
jft
.
_listen_host
()
if
self
.
jft
.
weinitiate
:
if
self
.
jft
.
weinitiate
:
# update connection's fileprops
# update connection's fileprops
self
.
jft
.
session
.
connection
.
files_props
[
self
.
jft
.
file_props
[
'
sid
'
]]
=
\
self
.
jft
.
session
.
connection
.
files_props
[
self
.
jft
.
file_props
[
'
sid
'
]]
=
\
self
.
jft
.
file_props
self
.
jft
.
file_props
# Listen on configured port for file transfer
# Listen on configured port for file transfer
self
.
jft
.
_listen_host
()
# TODO: Rename this to listen_host()
else
:
else
:
# Add file_props to the queue
# Add file_props to the queue
if
not
gajim
.
socks5queue
.
get_file_props
(
if
not
gajim
.
socks5queue
.
get_file_props
(
...
...
This diff is collapsed.
Click to expand it.
src/common/xmpp/protocol.py
+
1
−
1
View file @
038ea0fe
...
@@ -90,7 +90,7 @@ NS_JINGLE_ERRORS = 'urn:xmpp:jingle:errors:1' # XEP-0166
...
@@ -90,7 +90,7 @@ NS_JINGLE_ERRORS = 'urn:xmpp:jingle:errors:1' # XEP-0166
NS_JINGLE_RTP
=
'
urn:xmpp:jingle:apps:rtp:1
'
# XEP-0167
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_AUDIO
=
'
urn:xmpp:jingle:apps:rtp:audio
'
# XEP-0167
NS_JINGLE_RTP_VIDEO
=
'
urn:xmpp:jingle:apps:rtp:video
'
# 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_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_RAW_UDP
=
'
urn:xmpp:jingle:transports:raw-udp:1
'
# XEP-0177
NS_JINGLE_ICE_UDP
=
'
urn:xmpp:jingle:transports:ice-udp:1
'
# XEP-0176
NS_JINGLE_ICE_UDP
=
'
urn:xmpp:jingle:transports:ice-udp:1
'
# XEP-0176
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment