Make GBufferedInputStream pollable
Submitted by Matthew Barnes
Link to original bug (#726797)
Description
I notice GConverterInputStream implements GPollableInputStream.
It seems to me like GBufferedInputStream could also implement the interface.
Currently I'm having to avoid using GBufferedInputStream for some work I'm doing in Camel because it's not pollable and I can't seem to easily append to the internal buffer without using a some kind of blocking read call. Instead I've implemented my own buffered GInputStream subclass which is pollable, and seems to work fine.
Similar to GConverterInputStream, a GBufferedInputStream would only really be pollable if its base stream is pollable.
Also I think this would be a nice addition to the API:
gssize g_buffered_input_stream_fill_nonblocking (GBufferedInputStream *stream, GCancellable *cancellable, GError **error)
This would just do a non-blocking read on the base stream (if possible), buffer whatever data is immediately available and return the number of bytes read.
I can try and provide a patch if this request is deemed sane.
Version: 2.39.x