diff options
| author | Marvin W <git@larma.de> | 2025-10-03 18:23:37 +0200 |
|---|---|---|
| committer | Marvin W <git@larma.de> | 2025-10-06 21:25:44 +0200 |
| commit | 5a3c1754007b6d1ad99edf57d6bb37f52743f463 (patch) | |
| tree | b0ddfca89a664de59812e4b394d37f452b59da07 /libdino/src/util | |
| parent | 0b633088209cee4113802726da1a7ff0f0e9eac3 (diff) | |
Handle issues with libsoup
Workaround https://gitlab.gnome.org/GNOME/libsoup/-/issues/473 and https://gitlab.gnome.org/GNOME/glib-networking/-/issues/20
Diffstat (limited to 'libdino/src/util')
| -rw-r--r-- | libdino/src/util/limit_input_stream.vala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libdino/src/util/limit_input_stream.vala b/libdino/src/util/limit_input_stream.vala index 5569d778..8f95ce62 100644 --- a/libdino/src/util/limit_input_stream.vala +++ b/libdino/src/util/limit_input_stream.vala @@ -23,7 +23,10 @@ public class Dino.LimitInputStream : InputStream, PollableInputStream { public bool is_readable() { if (!can_poll()) throw new IOError.NOT_SUPPORTED("Stream is not pollable"); - return remaining_bytes == 0 || ((PollableInputStream)inner).is_readable(); + // Due to https://gitlab.gnome.org/GNOME/libsoup/-/issues/473 and + // https://gitlab.gnome.org/GNOME/glib-networking/-/issues/20, is_readable() can return false when + // approaching end of stream even if the stream is readable. + return remaining_bytes < 65536 || ((PollableInputStream)inner).is_readable(); } private ssize_t check_limit(ssize_t read) throws IOError { |
