Don't require HttpChunkAggregator to be present in pipeline for Web Sockets.
This commit is contained in:
parent
549546f944
commit
f7a4a646f8
@ -164,7 +164,9 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
|
||||
|
||||
// Upgrade the connection and send the handshake response.
|
||||
ChannelPipeline p = channel.getPipeline();
|
||||
p.remove(HttpChunkAggregator.class);
|
||||
if (p.get(HttpChunkAggregator.class) != null) {
|
||||
p.remove(HttpChunkAggregator.class);
|
||||
}
|
||||
p.replace(HttpRequestDecoder.class, "wsdecoder", new WebSocket00FrameDecoder());
|
||||
|
||||
ChannelFuture future = channel.write(res);
|
||||
|
@ -138,7 +138,10 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
|
||||
|
||||
// Upgrade the connection and send the handshake response.
|
||||
ChannelPipeline p = channel.getPipeline();
|
||||
p.remove(HttpChunkAggregator.class);
|
||||
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));
|
||||
|
||||
|
@ -139,7 +139,10 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
|
||||
|
||||
// Upgrade the connection and send the handshake response.
|
||||
ChannelPipeline p = channel.getPipeline();
|
||||
p.remove(HttpChunkAggregator.class);
|
||||
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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user