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
feffa352
Commit
feffa352
authored
Jan 01, 2023
by
Philipp Hörist
Browse files
new: HTTP: Add more logging
parent
4bed9a95
Changes
1
Hide whitespace changes
Inline
Side-by-side
nbxmpp/http.py
View file @
feffa352
...
...
@@ -290,7 +290,7 @@ class HTTPRequest(GObject.GObject):
self
.
_timeout_id
=
GLib
.
timeout_add_seconds
(
timeout
,
self
.
_on_timeout
)
self
.
_log
.
info
(
'Request sent
'
)
self
.
_log
.
info
(
'Request sent
, method: %s, uri: %s'
,
method
,
uri_string
)
def
_on_request_body_progress
(
self
,
_message
:
Soup
.
Message
,
...
...
@@ -325,8 +325,10 @@ class HTTPRequest(GObject.GObject):
self
.
_set_failed
(
HTTPRequestError
.
UNKNOWN
)
return
if
self
.
_message
.
get_status
()
not
in
(
Soup
.
Status
.
OK
,
Soup
.
Status
.
CREATED
):
status
=
self
.
_message
.
get_status
()
if
status
not
in
(
Soup
.
Status
.
OK
,
Soup
.
Status
.
CREATED
):
self
.
_log
.
info
(
'Response status: %s %s'
,
int
(
status
),
self
.
_message
.
get_reason_phrase
())
self
.
_set_failed
(
HTTPRequestError
.
STATUS_NOT_OK
)
return
...
...
@@ -421,6 +423,11 @@ class HTTPRequest(GObject.GObject):
return
self
.
_response_content_type
=
content_type
self
.
_log
.
info
(
'Sniffed: content-type: %s, content-length: %s'
,
self
.
_response_content_type
,
self
.
_response_content_length
)
self
.
emit
(
'content-sniffed'
,
self
.
_response_content_length
,
self
.
_response_content_type
)
...
...
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