Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2023-05-21 12:25:00 +0300
committerPhilipp Hörist <philipp@hoerist.com>2023-05-21 12:25:00 +0300
commit025d8211eb0a3746d94ca6a3fcdf2ca8cd3d9f86 (patch)
tree552b1d6fcbf30e10100adbd07a7382c33b52ac5b
parent5afb2b4a14e62b3b5f9b0d1c2843ba9575fd5c50 (diff)
cfix: HTTP: Don’t cancel() on overlow for Soup < 3.4.0
-rw-r--r--nbxmpp/http.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/nbxmpp/http.py b/nbxmpp/http.py
index 316ba63..2151b06 100644
--- a/nbxmpp/http.py
+++ b/nbxmpp/http.py
@@ -459,8 +459,11 @@ class HTTPRequest(GObject.GObject):
def _check_content_overflow(self) -> None:
if self._received_size > self._response_content_length:
- self._set_error(HTTPRequestError.CONTENT_OVERFLOW)
- self.cancel()
+ if MIN_SOUP_3_4:
+ self._set_error(HTTPRequestError.CONTENT_OVERFLOW)
+ self.cancel()
+ else:
+ self._finish_read(HTTPRequestError.CONTENT_OVERFLOW)
def _on_restarted(self, _message: Soup.Message) -> None:
self._log.info('Restarted')