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