diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-05-21 12:25:00 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-05-21 12:25:00 +0300 |
commit | 025d8211eb0a3746d94ca6a3fcdf2ca8cd3d9f86 (patch) | |
tree | 552b1d6fcbf30e10100adbd07a7382c33b52ac5b | |
parent | 5afb2b4a14e62b3b5f9b0d1c2843ba9575fd5c50 (diff) |
cfix: HTTP: Don’t cancel() on overlow for Soup < 3.4.0
-rw-r--r-- | nbxmpp/http.py | 7 |
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') |