Skip to content

Commit

Permalink
Fix NettyInputStream ByteBuf leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Gbillou committed Aug 10, 2019
1 parent 35e581f commit 33ea812
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public int read(byte[] b, int off, int len) throws IOException {

if (take.available() > 0) {
isList.addFirst(take);
} else {
take.close();
}

return read;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void run() {
ByteBuf content = httpContent.content();

if (content.isReadable()) {
isList.add(new ByteBufInputStream(content));
isList.add(new ByteBufInputStream(content, true));
}

if (msg instanceof LastHttpContent) {
Expand Down

0 comments on commit 33ea812

Please sign in to comment.