-
-
I'm not sure I have the read function implemented correctly. It works but https://docs.gtk.org/gio/method.InputStream.read.html says that 0 should only be returned if count is 0 or on EOF and we're not hitting either of those. Maybe we need to return an error with something like
EAGAIN
but I can't seem to find an error message for that.I also skipped implementing/testing closing the stream and skipping bytes, but not sure we actually need those?
Create Birb.StringStream
Review Request #3840 — Created Feb. 16, 2025 and updated
This is a simple Gio.InputStream that is backed by a GLib.String.
Ran the tests under valgrind and called in the turtles.
Summary | ID |
---|---|
5ebcf43193cb4bec8ab2bf79ecf8cd5a8bd1f3f3 |
-
-
From the API as it is tested, I'm not really sure I see the difference here with
GMemoryInputStream
? -
A 0 return here (without input
count
of 0) should indicate EOF. That would imply the stream could not get any new data after that, though that is happening now.Maybe this should be
G_IO_ERROR_PENDING
,G_IO_ERROR_PARTIAL_INPUT
, orG_IO_ERROR_WOULD_BLOCK
(and/or possibly with implementingGPollableInputStream
for the latter.)