proxy-wasm-cpp-host icon indicating copy to clipboard operation
proxy-wasm-cpp-host copied to clipboard

setBuffer returns BadArgument when called in onRequestTrailers

Open michal-kopczynski opened this issue 2 years ago • 0 comments

We have a use case in which we buffer locally part of each body chunk and send it later, together with the following chunk. On the last chunk, we send the remaining part of previous chunk together with the whole last chunk. We do that by modifying buffer using setBuffer function.

This works fine unless the request includes trailers. In such case, last chunk is received in last invocation of onRequestBody, but there is no way to know that this is a last chunk as end_stream == false. And in onRequest/ResponseTrailers setting buffer is not possible (returns BadArgument).

michal-kopczynski avatar Mar 10 '23 20:03 michal-kopczynski