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
19864ec8
Commit
19864ec8
authored
12 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
correctly close file when we cancel a transfer. Fixes
#7281
parent
980492e3
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
+5
-2
5 additions, 2 deletions
src/common/protocol/bytestream.py
src/common/socks5.py
+7
-0
7 additions, 0 deletions
src/common/socks5.py
with
12 additions
and
2 deletions
src/common/protocol/bytestream.py
+
5
−
2
View file @
19864ec8
...
...
@@ -790,6 +790,7 @@ class ConnectionIBBytestream(ConnectionBytestream):
rep
=
nbxmpp
.
Protocol
(
'
iq
'
,
stanza
.
getFrom
(),
'
result
'
,
stanza
.
getTo
(),
{
'
id
'
:
stanza
.
getID
()})
file_props
.
block_size
=
blocksize
file_props
.
direction
=
'
<
'
file_props
.
seq
=
0
file_props
.
received_len
=
0
file_props
.
last_time
=
time
.
time
()
...
...
@@ -820,7 +821,6 @@ class ConnectionIBBytestream(ConnectionBytestream):
if
session
.
weinitiate
:
session
.
cancel_session
()
def
OpenStream
(
self
,
sid
,
to
,
fp
,
blocksize
=
4096
):
"""
Start new stream. You should provide stream id
'
sid
'
, the endpoind jid
...
...
@@ -997,7 +997,10 @@ class ConnectionIBBytestream(ConnectionBytestream):
break
else
:
if
stanza
.
getTag
(
'
data
'
):
if
self
.
IBBMessageHandler
(
conn
,
stanza
):
sid
=
stanza
.
getTagAttr
(
'
data
'
,
'
sid
'
)
file_props
=
FilesProp
.
getFileProp
(
self
.
name
,
sid
)
if
file_props
.
connected
and
self
.
IBBMessageHandler
(
conn
,
stanza
):
reply
=
stanza
.
buildReply
(
'
result
'
)
reply
.
delChild
(
'
data
'
)
conn
.
send
(
reply
)
...
...
This diff is collapsed.
Click to expand it.
src/common/socks5.py
+
7
−
0
View file @
19864ec8
...
...
@@ -538,6 +538,7 @@ class Socks5:
raise
IOError
,
e
def
close_file
(
self
):
# Close file we're sending from
if
self
.
file
:
if
not
self
.
file
.
closed
:
try
:
...
...
@@ -545,6 +546,12 @@ class Socks5:
except
Exception
:
pass
self
.
file
=
None
# Close file we're receiving into
if
self
.
file_props
.
fd
:
try
:
self
.
file_props
.
fd
.
close
()
except
Exception
:
pass
def
get_fd
(
self
):
"""
...
...
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