Make sure setHandshakeComplete() is called before the handler is replaced. See #332

This commit is contained in:
Norman Maurer 2012-05-18 21:27:19 +02:00
parent 288ed13b6b
commit 17cdc98499
3 changed files with 5 additions and 4 deletions

View File

@ -240,11 +240,11 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
String subprotocol = response.getHeader(Names.SEC_WEBSOCKET_PROTOCOL);
setActualSubprotocol(subprotocol);
setHandshakeComplete();
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
new WebSocket00FrameDecoder(getMaxFramePayloadLength()));
setHandshakeComplete();
}

View File

@ -229,10 +229,11 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
setActualSubprotocol(subprotocol);
setHandshakeComplete();
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
new WebSocket08FrameDecoder(false, allowExtensions, this.getMaxFramePayloadLength()));
setHandshakeComplete();
}
}

View File

@ -224,11 +224,11 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
String subprotocol = response.getHeader(Names.SEC_WEBSOCKET_PROTOCOL);
setActualSubprotocol(subprotocol);
setHandshakeComplete();
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
new WebSocket13FrameDecoder(false, allowExtensions, this.getMaxFramePayloadLength()));
setHandshakeComplete();
}
}