Call setHandshakeComplete() before the handler replacement (#332)

- Contributed by @normanmaurer
This commit is contained in:
Trustin Lee 2012-05-31 02:02:02 -07:00
parent c32df371ab
commit a494f201fc
3 changed files with 6 additions and 6 deletions

View File

@ -223,10 +223,10 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
String subprotocol = response.getHeader(Names.SEC_WEBSOCKET_PROTOCOL);
setActualSubprotocol(subprotocol);
setHandshakeComplete();
channel.pipeline().get(HttpResponseDecoder.class).replace(
"ws-decoder", new WebSocket00FrameDecoder(getMaxFramePayloadLength()));
setHandshakeComplete();
}
private static String insertRandomCharacters(String key) {

View File

@ -200,10 +200,10 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
String subprotocol = response.getHeader(Names.SEC_WEBSOCKET_PROTOCOL);
setActualSubprotocol(subprotocol);
setHandshakeComplete();
channel.pipeline().get(HttpResponseDecoder.class).replace(
"ws-decoder",
new WebSocket08FrameDecoder(false, allowExtensions, getMaxFramePayloadLength()));
setHandshakeComplete();
}
}

View File

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