Fixed ClosedChannelException caused by previous 'chunk end mark' fix
This commit is contained in:
parent
fee1515818
commit
d809046987
@ -212,6 +212,7 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeSocket() {
|
void closeSocket() {
|
||||||
|
if (setClosed()) {
|
||||||
// Send the end of chunk.
|
// Send the end of chunk.
|
||||||
synchronized (writeLock) {
|
synchronized (writeLock) {
|
||||||
ChannelFuture future = channel.write(ChannelBuffers.copiedBuffer(
|
ChannelFuture future = channel.write(ChannelBuffers.copiedBuffer(
|
||||||
@ -221,10 +222,11 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
|
|||||||
"ASCII"));
|
"ASCII"));
|
||||||
future.awaitUninterruptibly();
|
future.awaitUninterruptibly();
|
||||||
}
|
}
|
||||||
setClosed();
|
|
||||||
closed = true;
|
closed = true;
|
||||||
channel.close();
|
channel.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void bindSocket(SocketAddress localAddress) {
|
void bindSocket(SocketAddress localAddress) {
|
||||||
channel.bind(localAddress);
|
channel.bind(localAddress);
|
||||||
|
Loading…
Reference in New Issue
Block a user