Don't require HttpChunkAggregator to be present in pipeline for Web Sockets.

This commit is contained in:
Carl Byström 2012-02-04 16:59:04 +01:00
parent 549546f944
commit f7a4a646f8
3 changed files with 11 additions and 3 deletions

View File

@ -164,7 +164,9 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
// Upgrade the connection and send the handshake response.
ChannelPipeline p = channel.getPipeline();
if (p.get(HttpChunkAggregator.class) != null) {
p.remove(HttpChunkAggregator.class);
}
p.replace(HttpRequestDecoder.class, "wsdecoder", new WebSocket00FrameDecoder());
ChannelFuture future = channel.write(res);

View File

@ -138,7 +138,10 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
// Upgrade the connection and send the handshake response.
ChannelPipeline p = channel.getPipeline();
if (p.get(HttpChunkAggregator.class) != null) {
p.remove(HttpChunkAggregator.class);
}
p.replace(HttpRequestDecoder.class, "wsdecoder", new WebSocket08FrameDecoder(true, allowExtensions));
p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket08FrameEncoder(false));

View File

@ -139,7 +139,10 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
// Upgrade the connection and send the handshake response.
ChannelPipeline p = channel.getPipeline();
if (p.get(HttpChunkAggregator.class) != null) {
p.remove(HttpChunkAggregator.class);
}
p.replace(HttpRequestDecoder.class, "wsdecoder", new WebSocket13FrameDecoder(true, allowExtensions));
p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket13FrameEncoder(false));