The callers expect the input brigade to be empty when the filter returns,
so buckets left on it leaked. Buckets put back with PSFS_FEED_ME to be seen
again with the next data are now kept by the user filter and prepended to
its input on the next call, which also fixes them aliasing the read chunk
buffer, being re-filtered by preceding filters in a chain and being lost
on the write path. Leftover buckets on any other status, or on the closing
call, are released with the existing warning.
Closes phpGH-20058
Co-authored-by: Nora Dossche <[email protected]>
Co-authored-by: Matthias Goergens <[email protected]>
The callers expect the input brigade to be empty when the filter returns, so buckets left on it leaked. Buckets put back with PSFS_FEED_ME to be seen again with the next data are now kept by the user filter and prepended to its input on the next call, which also fixes them aliasing the read chunk buffer, being re-filtered by preceding filters in a chain and being lost on the write path. Leftover buckets on any other status, or on the closing call, are released with the existing warning.
This is alternative to #20058