Issue #3298 - bug fixes for jetty websockets
succeed callback when you do not have a message sink OnWebSocketFrame annotation should take an API frame not a core frame Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
bd4f9b30fc
commit
6a98cc0bd2
|
@ -236,7 +236,10 @@ public class JettyWebSocketFrameHandler implements FrameHandler
|
|||
{
|
||||
// No message sink is active
|
||||
if (activeMessageSink == null)
|
||||
{
|
||||
callback.succeeded();
|
||||
return;
|
||||
}
|
||||
|
||||
// Accept the payload into the message sink
|
||||
activeMessageSink.accept(frame, callback);
|
||||
|
|
|
@ -61,7 +61,6 @@ import org.eclipse.jetty.websocket.common.message.PartialTextMessageSink;
|
|||
import org.eclipse.jetty.websocket.common.message.ReaderMessageSink;
|
||||
import org.eclipse.jetty.websocket.common.message.StringMessageSink;
|
||||
import org.eclipse.jetty.websocket.common.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
|
||||
/**
|
||||
* Factory to create {@link JettyWebSocketFrameHandler} instances suitable for
|
||||
|
@ -351,7 +350,7 @@ public class JettyWebSocketFrameHandlerFactory extends ContainerLifeCycle
|
|||
{
|
||||
assertSignatureValid(endpointClass, onmethod, OnWebSocketFrame.class);
|
||||
final InvokerUtils.Arg SESSION = new InvokerUtils.Arg(Session.class);
|
||||
final InvokerUtils.Arg FRAME = new InvokerUtils.Arg(Frame.class).required();
|
||||
final InvokerUtils.Arg FRAME = new InvokerUtils.Arg(org.eclipse.jetty.websocket.api.extensions.Frame.class).required();
|
||||
MethodHandle methodHandle = InvokerUtils.mutatedInvoker(endpointClass, onmethod, SESSION, FRAME);
|
||||
metadata.setFrameHandler(methodHandle, onmethod);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.eclipse.jetty.websocket.common.endpoints.annotated;
|
|||
|
||||
import org.eclipse.jetty.websocket.api.annotations.OnWebSocketFrame;
|
||||
import org.eclipse.jetty.websocket.api.annotations.WebSocket;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.api.extensions.Frame;
|
||||
|
||||
@WebSocket
|
||||
public class FrameSocket
|
||||
|
|
|
@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test;
|
|||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
public class JettyWebsocketTest
|
||||
public class JettyWebSocketTest
|
||||
{
|
||||
|
||||
@WebSocket
|
||||
|
|
Loading…
Reference in New Issue