Fix a bug in suspend read. See #71

This commit is contained in:
norman 2012-08-01 11:35:03 +02:00
parent 6a15f7f5ce
commit a3a58ecbc0
2 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
final AtomicReference<ByteBridge> inByteBridge;
final AtomicReference<ByteBridge> outByteBridge;
final AtomicBoolean suspendRead = new AtomicBoolean();
final AtomicBoolean readable = new AtomicBoolean(true);
// Runnables that calls handlers
final Runnable fireChannelRegisteredTask = new Runnable() {
@ -800,7 +800,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
@Override
public boolean isReadable() {
return !suspendRead.get();
return readable.get();
}
@Override

View File

@ -1450,7 +1450,7 @@ public class DefaultChannelPipeline implements ChannelPipeline {
}
void readable(DefaultChannelHandlerContext ctx, boolean readable) {
if (ctx.suspendRead.compareAndSet(!readable, readable)) {
if (ctx.readable.compareAndSet(!readable, readable)) {
if (!readable) {
if (suspendRead.incrementAndGet() == 1) {
unsafe.suspendRead();