Fixed a bug where discardReadBytes is called in a wrong place

This commit is contained in:
Trustin Lee 2012-07-10 14:25:46 +09:00
parent 917ed5173e
commit d66a187b5d

View File

@ -163,9 +163,9 @@ public class AioSocketChannel extends AbstractAioChannel implements SocketChanne
flushing = true; flushing = true;
if (buf.readable()) { if (buf.readable()) {
buf.discardReadBytes();
javaChannel().write(buf.nioBuffer(), this, WRITE_HANDLER); javaChannel().write(buf.nioBuffer(), this, WRITE_HANDLER);
} else { } else {
buf.discardReadBytes();
notifyFlushFutures(); notifyFlushFutures();
flushing = false; flushing = false;
} }