We should only disable releasing of the message once writeData(...) was called successfully (#9610)
Motivation: At the moment we set release to false before we call writeData(...). This could let to the sitatuation that we will miss to release the message if writeData(...) throws. We should set release to false after we called writeData(...) to ensure the ownership of the buffer is correctly transferred. Modifications: - Set release to false after writeData(...) was successfully called only Result: No possibility for a buffer leak
This commit is contained in:
parent
299a682d3f
commit
1f4b9e36ea
@ -110,8 +110,8 @@ public class HttpToHttp2ConnectionHandler extends Http2ConnectionHandler {
|
||||
// Write the data
|
||||
final ByteBuf content = ((HttpContent) msg).content();
|
||||
endStream = isLastContent && trailers.isEmpty();
|
||||
release = false;
|
||||
encoder.writeData(ctx, currentStreamId, content, 0, endStream, promiseAggregator.newPromise());
|
||||
release = false;
|
||||
|
||||
if (!trailers.isEmpty()) {
|
||||
// Write trailing headers.
|
||||
|
Loading…
Reference in New Issue
Block a user