Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gajim
python-nbxmpp
Commits
3e4fee24
Commit
3e4fee24
authored
Jan 17, 2023
by
Philipp Hörist
Browse files
fix: Handle race condition when cancelling request
Fixes
#136
parent
50c8c1cd
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nbxmpp/http.py
View file @
3e4fee24
...
...
@@ -449,6 +449,17 @@ class HTTPRequest(GObject.GObject):
self
.
_set_failed
(
HTTPRequestError
.
STATUS_NOT_OK
)
return
self
.
_log
.
info
(
'Request status: %s'
,
Soup
.
Status
.
get_phrase
(
status
))
if
self
.
_cancellable
.
is_cancelled
():
# It can happen that the message is finished before the
# response callback returns after calling cancel(). If
# we call complete, the response callback will also
# try to cleanup and will fail.
self
.
_log
.
info
(
'Skip setting message complete because '
'cancel is in progess'
)
return
self
.
_set_complete
()
def
_set_failed
(
self
,
error
:
HTTPRequestError
)
->
None
:
...
...
Philipp Hörist
@lovetox
mentioned in issue
gajim#11382 (closed)
·
Jan 23, 2023
mentioned in issue
gajim#11382 (closed)
mentioned in issue gajim#11382
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment