Commit Graph

2 Commits

Author SHA1 Message Date
Benjamin Otte
33b9338fb0 converteroutputstream: Raise error for data at end
When a conversion is finished, the code would return 0 from its write
vfunc. This is disallowed by the API of g_output_stream_write() and
causes g_output_stream_splice() as used by g_converter_convert_bytes()
to turn into an infinite loop.

Instead, raise a G_IO_ERROR_MESSAGE_TOO_LARGE error so that the calling
code can decide how to deal with it.

Testcase included.

Closes #3532
2024-11-16 07:46:24 +00:00
Matthias Clasen
0855968727 Add g_converter_convert_bytes
Add a utility api to apply a GConverter to data in memory.

Test included.
2024-05-09 15:03:55 +00:00