Fix a bug in suspend read. See #71
This commit is contained in:
parent
6a15f7f5ce
commit
a3a58ecbc0
@ -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
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user