[libsoup/carlosgc/item-cancellable: 1/2] filter-input-stream: check cancellable on read and skip
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/carlosgc/item-cancellable: 1/2] filter-input-stream: check cancellable on read and skip
- Date: Tue, 1 Jun 2021 15:00:13 +0000 (UTC)
commit be66006a60e08b686a91fb1da0819bd089fa12f5
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Tue Jun 1 13:08:51 2021 +0200
filter-input-stream: check cancellable on read and skip
When reading fro the base stream the cancellable is always checked, but
not when reading from the internal buffer.
libsoup/soup-filter-input-stream.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/libsoup/soup-filter-input-stream.c b/libsoup/soup-filter-input-stream.c
index 6ef11a05..b1e616c7 100644
--- a/libsoup/soup-filter-input-stream.c
+++ b/libsoup/soup-filter-input-stream.c
@@ -91,6 +91,9 @@ soup_filter_input_stream_read_fn (GInputStream *stream,
SoupFilterInputStreamPrivate *priv = soup_filter_input_stream_get_instance_private (fstream);
gssize bytes_read;
+ if (g_cancellable_set_error_if_cancelled (cancellable, error))
+ return -1;
+
if (!priv->in_read_until)
priv->need_more = FALSE;
@@ -116,6 +119,9 @@ soup_filter_input_stream_skip (GInputStream *stream,
SoupFilterInputStreamPrivate *priv = soup_filter_input_stream_get_instance_private (fstream);
gssize bytes_skipped;
+ if (g_cancellable_set_error_if_cancelled (cancellable, error))
+ return -1;
+
if (!priv->in_read_until)
priv->need_more = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]