[glib/wip/pwithnall/converter-stream-debugging] WIP
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/pwithnall/converter-stream-debugging] WIP
- Date: Tue, 5 Apr 2022 15:04:58 +0000 (UTC)
commit 836201d2bf4fe40a08e8b8b16d76f6238d5bf40d
Author: Philip Withnall <pwithnall endlessos org>
Date: Tue Apr 5 16:05:03 2022 +0100
WIP
Signed-off-by: Philip Withnall <pwithnall endlessos org>
gio/gconverterinputstream.c | 10 +++++-----
gio/tests/converter-stream.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gio/gconverterinputstream.c b/gio/gconverterinputstream.c
index fceb36f1c3..0edee0a018 100644
--- a/gio/gconverterinputstream.c
+++ b/gio/gconverterinputstream.c
@@ -602,20 +602,20 @@ g_converter_input_stream_is_readable (GPollableInputStream *stream)
{
GInputStream *base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream;
GConverterInputStream *cstream = G_CONVERTER_INPUT_STREAM (stream);
-
+/*
g_message ("converted_buffer size %lu, input_buffer size %lu, need_input %u, base_stream is %s",
buffer_data_size (&cstream->priv->converted_buffer),
buffer_data_size (&cstream->priv->input_buffer),
cstream->priv->need_input,
g_pollable_input_stream_is_readable (G_POLLABLE_INPUT_STREAM (base_stream)) ? "readable" : "not
readable");
-
+*/
if (buffer_data_size (&cstream->priv->converted_buffer))
- return TRUE;
+ return 1;
else if (buffer_data_size (&cstream->priv->input_buffer) &&
!cstream->priv->need_input)
- return TRUE;
+ return 2;
else
- return g_pollable_input_stream_is_readable (G_POLLABLE_INPUT_STREAM (base_stream));
+ return g_pollable_input_stream_is_readable (G_POLLABLE_INPUT_STREAM (base_stream)) ? 3 : 0;
}
static gssize
diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c
index 6ba741186e..6a9f1f0873 100644
--- a/gio/tests/converter-stream.c
+++ b/gio/tests/converter-stream.c
@@ -1041,7 +1041,7 @@ test_converter_pollable (void)
}
is_readable = g_pollable_input_stream_is_readable (pollable_in);
- g_test_message ("pollable_in is %s", is_readable ? "readable" : "not readable");
+ g_test_message ("pollable_in is %s (%u)", is_readable ? "readable" : "not readable", is_readable);
res = g_pollable_input_stream_read_nonblocking (pollable_in,
inptr, 1,
NULL, &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]