diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java index 5a64a45a1ac..7d9fdfdd36a 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java @@ -432,7 +432,7 @@ public abstract class AbstractWebSocketConnection extends AbstractConnection imp synchronized (writeBytes) { - writeBytes.enque(frame,WriteCallbackWrapper.wrap(callback)); + writeBytes.enqueue(frame,WriteCallbackWrapper.wrap(callback)); } flush(); diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/WriteBytesProvider.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/WriteBytesProvider.java index e14ba5dee89..0681e3d4d85 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/WriteBytesProvider.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/WriteBytesProvider.java @@ -97,10 +97,10 @@ public class WriteBytesProvider implements Callback this.closed = new AtomicBoolean(false); } - public void enque(Frame frame, Callback callback) + public void enqueue(Frame frame, Callback callback) { Objects.requireNonNull(frame); - LOG.debug("enque({}, {})",frame,callback); + LOG.debug("enqueue({}, {})",frame,callback); synchronized (this) { if (closed.get()) @@ -283,8 +283,16 @@ public class WriteBytesProvider implements Callback // All done with active FrameEntry if (active.callback != null) { - // notify of success - active.callback.succeeded(); + try + { + // TODO: should probably have callback invoked in new thread as part of scheduler + // notify of success + active.callback.succeeded(); + } + catch (Throwable t) + { + LOG.warn("Callback failure",t); + } } // null it out