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
eta
gajim
Commits
f4fa7057
Commit
f4fa7057
authored
12 years ago
by
zimio
Browse files
Options
Downloads
Patches
Plain Diff
fix connect error
parent
1c895779
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/protocol/bytestream.py
+16
-10
16 additions, 10 deletions
src/common/protocol/bytestream.py
src/filetransfers_window.py
+2
-0
2 additions, 0 deletions
src/filetransfers_window.py
with
18 additions
and
10 deletions
src/common/protocol/bytestream.py
+
16
−
10
View file @
f4fa7057
...
...
@@ -549,34 +549,40 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
file_props
.
hash_
=
hash_id
return
def
_connect_error
(
self
,
to
,
_id
,
sid
,
code
=
404
):
def
_connect_error
(
self
,
sid
,
code
=
404
):
"""
Called when there is an error establishing BS connection, or when
connection is rejected
"""
if
not
self
.
connection
or
self
.
connected
<
2
:
return
file_props
=
FilesProp
.
getFileProp
(
self
.
name
,
sid
)
if
file_props
is
None
:
log
.
error
(
'
can not send iq error on failed transfer
'
)
return
msg_dict
=
{
404
:
'
Could not connect to given hosts
'
,
405
:
'
Cancel
'
,
406
:
'
Not acceptable
'
,
}
msg
=
msg_dict
[
code
]
if
file_props
.
type_
==
'
s
'
:
to
=
file_props
.
receiver
else
:
to
=
file_props
.
sender
iq
=
xmpp
.
Iq
(
to
=
to
,
typ
=
'
error
'
)
iq
.
setAttr
(
'
id
'
,
_
id
)
iq
.
setAttr
(
'
id
'
,
file_props
.
session_s
id
)
err
=
iq
.
setTag
(
'
error
'
)
err
.
setAttr
(
'
code
'
,
unicode
(
code
))
err
.
setData
(
msg
)
self
.
connection
.
send
(
iq
)
if
code
==
404
:
file_props
=
FilesProp
.
getFileProp
(
self
.
name
,
sid
)
if
file_props
is
not
None
:
self
.
disconnect_transfer
(
file_props
)
file_props
.
error
=
-
3
from
common.connection_handlers_events
import
\
FileRequestErrorEvent
gajim
.
nec
.
push_incoming_event
(
FileRequestErrorEvent
(
None
,
conn
=
self
,
jid
=
to
,
file_props
=
file_props
,
error_msg
=
msg
))
self
.
disconnect_transfer
(
file_props
)
file_props
.
error
=
-
3
from
common.connection_handlers_events
import
\
FileRequestErrorEvent
gajim
.
nec
.
push_incoming_event
(
FileRequestErrorEvent
(
None
,
conn
=
self
,
jid
=
to
,
file_props
=
file_props
,
error_msg
=
msg
))
def
_proxy_auth_ok
(
self
,
proxy
):
"""
...
...
This diff is collapsed.
Click to expand it.
src/filetransfers_window.py
+
2
−
0
View file @
f4fa7057
...
...
@@ -553,6 +553,8 @@ class FileTransfersWindow:
def
_remove_transfer
(
self
,
iter_
,
sid
,
file_props
):
self
.
model
.
remove
(
iter_
)
if
not
file_props
:
return
if
file_props
.
tt_account
:
# file transfer is set
account
=
file_props
.
tt_account
...
...
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