Fixed broken chunked encoding in HttpTunnelingClientSocketChannel

This commit is contained in:
Trustin Lee 2009-04-21 09:49:20 +00:00
parent 5a18c91435
commit d2b6078eaa

View File

@ -166,12 +166,12 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel
int size = a.readableBytes(); int size = a.readableBytes();
String hex = Integer.toHexString(size) + HttpTunnelingClientSocketPipelineSink.LINE_TERMINATOR; String hex = Integer.toHexString(size) + HttpTunnelingClientSocketPipelineSink.LINE_TERMINATOR;
// try {
synchronized (writeLock) { synchronized (writeLock) {
a.writeBytes(HttpTunnelingClientSocketPipelineSink.LINE_TERMINATOR.getBytes()); ChannelFuture future = channel.write(ChannelBuffers.wrappedBuffer(
channel.write(ChannelBuffers.wrappedBuffer(hex.getBytes())); ChannelBuffers.copiedBuffer(hex, "ASCII"),
channel.write(a).awaitUninterruptibly(); a,
//channel.write(ChannelBuffers.wrappedBuffer(LINE_TERMINATOR.getBytes())); ChannelBuffers.copiedBuffer(HttpTunnelingClientSocketPipelineSink.LINE_TERMINATOR, "ASCII")));
future.awaitUninterruptibly();
} }
} }