Skip to content

Commit

Permalink
Fix unbounded expansion of cumulative buffer in SslHandler
Browse files Browse the repository at this point in the history
Motivation:
62057f7 introduced a regression where large amounts of memory could accumulate, and not be cleaned up in a timely manner.

Modifications:
- Call super.channelReadComplete() instead of calling ctx.fireChannelReadComplete()

Result:
Fixes netty#5928
  • Loading branch information
Scottmitch committed Oct 20, 2016
1 parent cfa5b85 commit 966f7c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion handler/src/main/java/io/netty/handler/ssl/SslHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,10 @@ public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
readIfNeeded(ctx);

firedChannelRead = false;
ctx.fireChannelReadComplete();
// The super class has a buffer which accumulates data and will discard bytes upon read complete.
// We need to call super.channelReadComplete(ctx) to prevent memory for accumulating.
// See https://github.com/netty/netty/issues/5928
super.channelReadComplete(ctx);
}

private void readIfNeeded(ChannelHandlerContext ctx) {
Expand Down

0 comments on commit 966f7c2

Please sign in to comment.