Fixed a problem where HttpTunnelingClientSocketChannel.setInterestOps() returns a wrong future
This commit is contained in:
parent
f0233fc1b8
commit
6805ea719b
@ -146,8 +146,20 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChannelFuture setInterestOps(int interestOps) {
|
public ChannelFuture setInterestOps(int interestOps) {
|
||||||
// TODO: Wrap the future.
|
final ChannelFuture future = future(this);
|
||||||
return channel.setInterestOps(interestOps);
|
channel.setInterestOps(interestOps).addListener(new ChannelFutureListener() {
|
||||||
|
public void operationComplete(ChannelFuture f)
|
||||||
|
throws Exception {
|
||||||
|
if (f.isSuccess()) {
|
||||||
|
future.setSuccess();
|
||||||
|
fireChannelInterestChanged(HttpTunnelingClientSocketChannel.this);
|
||||||
|
} else {
|
||||||
|
future.setFailure(f.getCause());
|
||||||
|
fireExceptionCaught(HttpTunnelingClientSocketChannel.this, f.getCause());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return future;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user