Do not call expandReadBuffer too often

This commit is contained in:
Trustin Lee 2012-05-20 14:30:26 +09:00
parent af37ec4f23
commit 3a8c10cc5a

View File

@ -648,7 +648,6 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
int localReadAmount = doRead(buf);
if (localReadAmount > 0) {
readAmount += localReadAmount;
expandReadBuffer(buf, hasByteBuffer);
} else if (localReadAmount == 0) {
if (!expandReadBuffer(buf, hasByteBuffer)) {
break;
@ -868,7 +867,7 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
ChannelBuffer byteBuf = buf.byteBuffer();
if (!byteBuf.writable()) {
// FIXME: Use a sensible value.
byteBuf.ensureWritableBytes(128);
byteBuf.ensureWritableBytes(4096);
return true;
}