Merge pull request #553 from jfallows/aio-unmodified-buffer

Ensure unmodified buffer delivered via pipeline after AIO read completes
This commit is contained in:
Norman Maurer 2012-08-24 09:25:01 -07:00
commit cd9a36d4e7
3 changed files with 3 additions and 2 deletions

View File

@ -46,6 +46,7 @@ final class AioServerSocketChannelConfig extends DefaultChannelConfig
}
@Override
@SuppressWarnings("unchecked")
public <T> T getOption(ChannelOption<T> option) {
if (option == SO_RCVBUF) {
return (T) Integer.valueOf(getReceiveBufferSize());

View File

@ -326,7 +326,6 @@ public class AioSocketChannel extends AbstractAioChannel implements SocketChanne
// This is needed as the ByteBuffer and the ByteBuf does not share
// each others index
byteBuf.writerIndex(byteBuf.writerIndex() + localReadAmount);
expandReadBuffer(byteBuf);
read = true;
} else if (localReadAmount < 0) {
@ -390,9 +389,9 @@ public class AioSocketChannel extends AbstractAioChannel implements SocketChanne
@Override
protected void completed0(Void result, AioSocketChannel channel) {
channel.beginRead();
((AbstractAioUnsafe) channel.unsafe()).connectSuccess();
channel.pipeline().fireChannelActive();
channel.beginRead();
}
@Override

View File

@ -57,6 +57,7 @@ final class AioSocketChannelConfig extends DefaultChannelConfig
}
@Override
@SuppressWarnings("unchecked")
public <T> T getOption(ChannelOption<T> option) {
if (option == SO_RCVBUF) {
return (T) Integer.valueOf(getReceiveBufferSize());