From d2b6078eaa6846dc64936d8b2f35d94552f5977b Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 21 Apr 2009 09:49:20 +0000 Subject: [PATCH] Fixed broken chunked encoding in HttpTunnelingClientSocketChannel --- .../socket/http/HttpTunnelingClientSocketChannel.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingClientSocketChannel.java b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingClientSocketChannel.java index 2a06f42ca9..07a527d390 100644 --- a/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingClientSocketChannel.java +++ b/src/main/java/org/jboss/netty/channel/socket/http/HttpTunnelingClientSocketChannel.java @@ -166,12 +166,12 @@ class HttpTunnelingClientSocketChannel extends AbstractChannel int size = a.readableBytes(); String hex = Integer.toHexString(size) + HttpTunnelingClientSocketPipelineSink.LINE_TERMINATOR; - // try { synchronized (writeLock) { - a.writeBytes(HttpTunnelingClientSocketPipelineSink.LINE_TERMINATOR.getBytes()); - channel.write(ChannelBuffers.wrappedBuffer(hex.getBytes())); - channel.write(a).awaitUninterruptibly(); - //channel.write(ChannelBuffers.wrappedBuffer(LINE_TERMINATOR.getBytes())); + ChannelFuture future = channel.write(ChannelBuffers.wrappedBuffer( + ChannelBuffers.copiedBuffer(hex, "ASCII"), + a, + ChannelBuffers.copiedBuffer(HttpTunnelingClientSocketPipelineSink.LINE_TERMINATOR, "ASCII"))); + future.awaitUninterruptibly(); } }