- if (isHelloMessage(doc)) {
- changeState(State.ESTABLISHED);
- S session = getSession(sessionListener, channel, doc);
- negotiationSuccessful(session);
- } else {
- final IllegalStateException cause = new IllegalStateException(
- "Received message was not hello as expected, but was " + XmlUtil.toString(doc));
- negotiationFailed(cause);
+ replaceHelloMessageHandlers();
+
+ if (shouldUseChunkFraming(doc)) {
+ insertChunkFramingToPipeline();