Fix regression which lead to leak buffers when nothing could be read from the Channel.

This was introduced as part of #1812, but fortunatualy was not part of any release.
This commit is contained in:
Norman Maurer 2013-11-07 07:12:19 +01:00
parent d2032254b7
commit 77054d7ecb

View File

@ -114,6 +114,8 @@ public abstract class AbstractNioByteChannel extends AbstractNioChannel {
byteBuf = allocHandle.allocate(allocator);
int localReadAmount = doReadBytes(byteBuf);
if (localReadAmount <= 0) {
// not was read release the buffer
byteBuf.release();
close = localReadAmount < 0;
break;
}