Skip to content

Commit 2e8b098

Browse files
author
Stephane Landelle
committed
Handle Continuation frames, close AsyncHttpClient#674
1 parent a5d66dc commit 2e8b098

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/ning/http/client/providers/netty/channel/ChannelManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.jboss.netty.handler.codec.http.HttpContentDecompressor;
3232
import org.jboss.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder;
3333
import org.jboss.netty.handler.codec.http.websocketx.WebSocket08FrameEncoder;
34+
import org.jboss.netty.handler.codec.http.websocketx.WebSocketFrameAggregator;
3435
import org.jboss.netty.handler.ssl.SslHandler;
3536
import org.jboss.netty.handler.stream.ChunkedWriteHandler;
3637
import org.jboss.netty.util.Timer;
@@ -75,6 +76,7 @@ public class ChannelManager {
7576
public static final String INFLATER_HANDLER = "inflater";
7677
public static final String CHUNKED_WRITER_HANDLER = "chunkedWriter";
7778
public static final String WS_DECODER_HANDLER = "ws-decoder";
79+
public static final String WS_FRAME_AGGREGATOR = "ws-aggregator";
7880
public static final String WS_ENCODER_HANDLER = "ws-encoder";
7981

8082
private final AsyncHttpClientConfig config;
@@ -418,6 +420,7 @@ public void upgradePipelineForWebSockets(ChannelPipeline pipeline) {
418420
pipeline.addAfter(HTTP_HANDLER, WS_ENCODER_HANDLER, new WebSocket08FrameEncoder(true));
419421
pipeline.remove(HTTP_HANDLER);
420422
pipeline.addBefore(WS_PROCESSOR, WS_DECODER_HANDLER, new WebSocket08FrameDecoder(false, false, 10 * 1024));
423+
pipeline.addAfter(WS_DECODER_HANDLER, WS_FRAME_AGGREGATOR, new WebSocketFrameAggregator(10 * 1024));
421424
}
422425

423426
public final Callback newDrainCallback(final NettyResponseFuture<?> future, final Channel channel, final boolean keepAlive,

0 commit comments

Comments
 (0)