From 5f20651d061c8025610e80769851532c1374461f Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 24 Jan 2019 09:48:30 +1100 Subject: [PATCH] Issue #3290 websocket onOpen states Signed-off-by: Greg Wilkins --- .../eclipse/jetty/websocket/core/internal/WebSocketChannel.java | 2 +- .../jetty/websocket/core/internal/WebSocketChannelState.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketChannel.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketChannel.java index ec4e158044a..7bc836703d7 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketChannel.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketChannel.java @@ -398,8 +398,8 @@ public class WebSocketChannel implements IncomingFrames, FrameHandler.CoreSessio LOG.debug("ConnectionState: Transition to CONNECTED"); // Open connection and handler - channelState.onOpen(); handler.onOpen(this); + channelState.onOpen(); if (!demanding) connection.demand(1); diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketChannelState.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketChannelState.java index 815959e940a..a462819e20f 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketChannelState.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketChannelState.java @@ -98,7 +98,7 @@ public class WebSocketChannelState public boolean isOutputOpen() { State state = getState(); - return (state==State.OPEN || state==State.ISHUT); + return (state==State.CONNECTED || state==State.OPEN || state==State.ISHUT); } public CloseStatus getCloseStatus()