Merge pull request #9356 from eclipse/jetty-12.0.x-websocket-JPMS
cleanup of websocket to fix JPMS warnings
This commit is contained in:
commit
81046650ab
|
@ -38,7 +38,7 @@
|
|||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Export-Package>*,org.eclipse.jetty.websocket.core.client.internal.*</Export-Package>
|
||||
<Export-Package>*</Export-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
|
@ -47,16 +47,16 @@ import org.eclipse.jetty.websocket.core.Behavior;
|
|||
import org.eclipse.jetty.websocket.core.Configuration;
|
||||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||
import org.eclipse.jetty.websocket.core.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConnection;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConstants;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.client.internal.HttpUpgraderOverHTTP;
|
||||
import org.eclipse.jetty.websocket.core.client.internal.HttpUpgraderOverHTTP2;
|
||||
import org.eclipse.jetty.websocket.core.exception.UpgradeException;
|
||||
import org.eclipse.jetty.websocket.core.exception.WebSocketException;
|
||||
import org.eclipse.jetty.websocket.core.internal.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.internal.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketConnection;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -480,8 +480,8 @@ public abstract class CoreClientUpgradeRequest implements Response.CompleteListe
|
|||
HttpClient httpClient = wsClient.getHttpClient();
|
||||
ByteBufferPool bufferPool = wsClient.getWebSocketComponents().getByteBufferPool();
|
||||
WebSocketConnection wsConnection = new WebSocketConnection(endPoint, httpClient.getExecutor(), httpClient.getScheduler(), bufferPool, coreSession);
|
||||
wsClient.getEventListeners().forEach(wsConnection::addEventListener);
|
||||
coreSession.setWebSocketConnection(wsConnection);
|
||||
wsClient.getEventListeners().forEach(wsConnection::addEventListener);
|
||||
Throwable listenerError = notifyUpgradeListeners((listener) -> listener.onHandshakeResponse(request, response));
|
||||
if (listenerError != null)
|
||||
throw new WebSocketException("onHandshakeResponse error", listenerError);
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.eclipse.jetty.io.EndPoint;
|
|||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConstants;
|
||||
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCore;
|
||||
import org.eclipse.jetty.websocket.core.util.WebSocketUtils;
|
||||
|
||||
public class HttpUpgraderOverHTTP implements HttpUpgrader
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ public class HttpUpgraderOverHTTP implements HttpUpgrader
|
|||
{
|
||||
// Check the Accept hash
|
||||
String reqKey = requestHeaders.get(HttpHeader.SEC_WEBSOCKET_KEY);
|
||||
String expectedHash = WebSocketCore.hashKey(reqKey);
|
||||
String expectedHash = WebSocketUtils.hashKey(reqKey);
|
||||
String respHash = responseHeaders.get(HttpHeader.SEC_WEBSOCKET_ACCEPT);
|
||||
if (expectedHash.equalsIgnoreCase(respHash))
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-Description>Jetty Websocket Core Common</Bundle-Description>
|
||||
<Export-Package>*,org.eclipse.jetty.websocket.core.common.internal.*</Export-Package>
|
||||
<Export-Package>*</Export-Package>
|
||||
<Require-Capability>
|
||||
osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"; resolution:=optional
|
||||
</Require-Capability>
|
||||
|
|
|
@ -21,53 +21,11 @@ module org.eclipse.jetty.websocket.core.common
|
|||
|
||||
exports org.eclipse.jetty.websocket.core;
|
||||
exports org.eclipse.jetty.websocket.core.exception;
|
||||
|
||||
exports org.eclipse.jetty.websocket.core.messages;
|
||||
exports org.eclipse.jetty.websocket.core.util;
|
||||
exports org.eclipse.jetty.websocket.core.internal to
|
||||
org.eclipse.jetty.websocket.core.client,
|
||||
org.eclipse.jetty.websocket.core.server,
|
||||
org.eclipse.jetty.util; // Export to DecoratedObjectFactory.
|
||||
|
||||
// The Jetty & Jakarta API Layers need to access both access some internal utilities which we don't want to expose.
|
||||
exports org.eclipse.jetty.websocket.core.internal.util to
|
||||
org.eclipse.jetty.ee8.websocket.jetty.common,
|
||||
org.eclipse.jetty.ee8.websocket.jetty.client,
|
||||
org.eclipse.jetty.ee8.websocket.jetty.server,
|
||||
org.eclipse.jetty.ee8.websocket.javax.common,
|
||||
org.eclipse.jetty.ee8.websocket.javax.client,
|
||||
org.eclipse.jetty.ee8.websocket.javax.server,
|
||||
org.eclipse.jetty.ee9.websocket.jetty.common,
|
||||
org.eclipse.jetty.ee9.websocket.jetty.client,
|
||||
org.eclipse.jetty.ee9.websocket.jetty.server,
|
||||
org.eclipse.jetty.ee9.websocket.jakarta.common,
|
||||
org.eclipse.jetty.ee9.websocket.jakarta.client,
|
||||
org.eclipse.jetty.ee9.websocket.jakarta.server,
|
||||
org.eclipse.jetty.ee10.websocket.jetty.common,
|
||||
org.eclipse.jetty.ee10.websocket.jetty.client,
|
||||
org.eclipse.jetty.ee10.websocket.jetty.server,
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.common,
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.client,
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.server;
|
||||
|
||||
exports org.eclipse.jetty.websocket.core.internal.messages to
|
||||
org.eclipse.jetty.ee8.websocket.jetty.common,
|
||||
org.eclipse.jetty.ee8.websocket.jetty.client,
|
||||
org.eclipse.jetty.ee8.websocket.jetty.server,
|
||||
org.eclipse.jetty.ee8.websocket.javax.common,
|
||||
org.eclipse.jetty.ee8.websocket.javax.client,
|
||||
org.eclipse.jetty.ee8.websocket.javax.server,
|
||||
org.eclipse.jetty.ee9.websocket.jetty.common,
|
||||
org.eclipse.jetty.ee9.websocket.jetty.client,
|
||||
org.eclipse.jetty.ee9.websocket.jetty.server,
|
||||
org.eclipse.jetty.ee9.websocket.jakarta.common,
|
||||
org.eclipse.jetty.ee9.websocket.jakarta.client,
|
||||
org.eclipse.jetty.ee9.websocket.jakarta.server,
|
||||
org.eclipse.jetty.ee10.websocket.jetty.common,
|
||||
org.eclipse.jetty.ee10.websocket.jetty.client,
|
||||
org.eclipse.jetty.ee10.websocket.jetty.server,
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.common,
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.client,
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.server;
|
||||
|
||||
uses org.eclipse.jetty.websocket.core.Extension;
|
||||
|
||||
provides org.eclipse.jetty.websocket.core.Extension with
|
||||
|
|
|
@ -25,13 +25,8 @@ import org.eclipse.jetty.util.Callback;
|
|||
/**
|
||||
* Represents the outgoing Frames.
|
||||
*/
|
||||
public interface CoreSession extends OutgoingFrames, Configuration
|
||||
public interface CoreSession extends OutgoingFrames, IncomingFrames, Configuration
|
||||
{
|
||||
/**
|
||||
* The negotiated WebSocket Sub-Protocol for this session.
|
||||
*
|
||||
* @return the negotiated WebSocket Sub-Protocol for this session.
|
||||
*/
|
||||
String getNegotiatedSubProtocol();
|
||||
|
||||
/**
|
||||
|
@ -120,11 +115,8 @@ public interface CoreSession extends OutgoingFrames, Configuration
|
|||
*/
|
||||
boolean isOutputOpen();
|
||||
|
||||
/**
|
||||
* If using BatchMode.ON or BatchMode.AUTO, trigger a flush of enqueued / batched frames.
|
||||
*
|
||||
* @param callback the callback to track close frame sent (or failed)
|
||||
*/
|
||||
boolean isClosed();
|
||||
|
||||
void flush(Callback callback);
|
||||
|
||||
/**
|
||||
|
@ -270,6 +262,12 @@ public interface CoreSession extends OutgoingFrames, Configuration
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush(Callback callback)
|
||||
{
|
||||
|
@ -293,6 +291,12 @@ public interface CoreSession extends OutgoingFrames, Configuration
|
|||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFrame(Frame frame, Callback callback)
|
||||
{
|
||||
callback.succeeded();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendFrame(Frame frame, Callback callback, boolean batch)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
package org.eclipse.jetty.websocket.core;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -26,14 +26,8 @@ import org.eclipse.jetty.util.Callback;
|
|||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.component.Dumpable;
|
||||
import org.eclipse.jetty.websocket.core.Behavior;
|
||||
import org.eclipse.jetty.websocket.core.Extension;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.IncomingFrames;
|
||||
import org.eclipse.jetty.websocket.core.OutgoingFrames;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.exception.WebSocketException;
|
||||
import org.eclipse.jetty.websocket.core.util.DemandChain;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -258,7 +252,7 @@ public class ExtensionStack implements IncomingFrames, OutgoingFrames, Dumpable
|
|||
outgoing.sendFrame(frame, callback, batch);
|
||||
}
|
||||
|
||||
public void initialize(IncomingFrames incoming, OutgoingFrames outgoing, WebSocketCoreSession coreSession)
|
||||
public void initialize(IncomingFrames incoming, OutgoingFrames outgoing, CoreSession coreSession)
|
||||
{
|
||||
if (extensions == null)
|
||||
throw new IllegalStateException();
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
package org.eclipse.jetty.websocket.core;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
@ -510,4 +511,54 @@ public class Frame
|
|||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Parsed extends Frame implements Closeable, CloseStatus.Supplier
|
||||
{
|
||||
final CloseStatus closeStatus;
|
||||
final Runnable releaser;
|
||||
|
||||
public Parsed(byte firstByte, byte[] mask, ByteBuffer payload, Runnable releaser)
|
||||
{
|
||||
super(firstByte, mask, payload);
|
||||
demask();
|
||||
this.releaser = releaser;
|
||||
if (getOpCode() == OpCode.CLOSE)
|
||||
{
|
||||
if (hasPayload())
|
||||
closeStatus = new CloseStatus(payload.duplicate());
|
||||
else
|
||||
closeStatus = CloseStatus.NO_CODE_STATUS;
|
||||
}
|
||||
else
|
||||
{
|
||||
closeStatus = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close()
|
||||
{
|
||||
if (releaser != null)
|
||||
releaser.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloseStatus getCloseStatus()
|
||||
{
|
||||
return closeStatus;
|
||||
}
|
||||
|
||||
public boolean isReleaseable()
|
||||
{
|
||||
return releaser != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (closeStatus == null)
|
||||
return super.toString();
|
||||
return super.toString() + ":" + closeStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
package org.eclipse.jetty.websocket.core;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
@ -23,11 +23,9 @@ import java.util.Objects;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.jetty.http.HttpScheme;
|
||||
import org.eclipse.jetty.util.MultiMap;
|
||||
import org.eclipse.jetty.util.Fields;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.UrlEncoded;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConstants;
|
||||
|
||||
public class Negotiated
|
||||
{
|
||||
|
@ -56,11 +54,11 @@ public class Negotiated
|
|||
else
|
||||
{
|
||||
map = new HashMap<>();
|
||||
MultiMap<String> params = new MultiMap<>();
|
||||
UrlEncoded.decodeUtf8To(rawQuery, params);
|
||||
for (String p : params.keySet())
|
||||
Fields fields = new Fields();
|
||||
UrlEncoded.decodeUtf8To(rawQuery, fields);
|
||||
for (Fields.Field field : fields)
|
||||
{
|
||||
map.put(p, Collections.unmodifiableList(params.getValues(p)));
|
||||
map.put(field.getValue(), Collections.unmodifiableList(field.getValues()));
|
||||
}
|
||||
}
|
||||
this.parameterMap = Collections.unmodifiableMap(map);
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
package org.eclipse.jetty.websocket.core;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
@ -34,9 +34,10 @@ import org.eclipse.jetty.util.MathUtils;
|
|||
import org.eclipse.jetty.util.component.Dumpable;
|
||||
import org.eclipse.jetty.util.thread.AutoLock;
|
||||
import org.eclipse.jetty.util.thread.Scheduler;
|
||||
import org.eclipse.jetty.websocket.core.Behavior;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.exception.WebSocketTimeoutException;
|
||||
import org.eclipse.jetty.websocket.core.internal.FrameFlusher;
|
||||
import org.eclipse.jetty.websocket.core.internal.Generator;
|
||||
import org.eclipse.jetty.websocket.core.internal.Parser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -129,16 +130,6 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
|
|||
return super.getExecutor();
|
||||
}
|
||||
|
||||
public Generator getGenerator()
|
||||
{
|
||||
return generator;
|
||||
}
|
||||
|
||||
public Parser getParser()
|
||||
{
|
||||
return parser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the local InetSocketAddress
|
||||
* @deprecated use {@link #getLocalSocketAddress()} instead
|
||||
|
@ -180,6 +171,11 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
|
|||
return useInputDirectByteBuffers;
|
||||
}
|
||||
|
||||
public void setWriteTimeout(long writeTimeout)
|
||||
{
|
||||
flusher.setIdleTimeout(writeTimeout);
|
||||
}
|
||||
|
||||
public void setUseInputDirectByteBuffers(boolean useInputDirectByteBuffers)
|
||||
{
|
||||
this.useInputDirectByteBuffers = useInputDirectByteBuffers;
|
||||
|
@ -239,7 +235,7 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
|
|||
return false;
|
||||
}
|
||||
|
||||
protected void onFrame(Parser.ParsedFrame frame)
|
||||
protected void onFrame(Frame.Parsed frame)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("onFrame({})", frame);
|
||||
|
@ -427,7 +423,7 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
|
|||
// Parse and handle frames
|
||||
while (networkBuffer.hasRemaining())
|
||||
{
|
||||
Parser.ParsedFrame frame = parser.parse(networkBuffer.getByteBuffer());
|
||||
Frame.Parsed frame = parser.parse(networkBuffer.getByteBuffer());
|
||||
if (frame == null)
|
||||
break;
|
||||
|
||||
|
@ -573,11 +569,6 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
|
|||
setInitialBuffer(buffer);
|
||||
}
|
||||
|
||||
public FrameFlusher getFrameFlusher()
|
||||
{
|
||||
return flusher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMessagesIn()
|
||||
{
|
||||
|
@ -609,7 +600,7 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
|
|||
* @param callback The callback to call once the frame is sent
|
||||
* @param batch True if batch mode is to be used
|
||||
*/
|
||||
void enqueueFrame(Frame frame, Callback callback, boolean batch)
|
||||
public void enqueueFrame(Frame frame, Callback callback, boolean batch)
|
||||
{
|
||||
if (coreSession.getBehavior() == Behavior.CLIENT)
|
||||
{
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
package org.eclipse.jetty.websocket.core;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.SocketAddress;
|
||||
|
@ -30,23 +30,14 @@ import org.eclipse.jetty.io.ByteBufferPool;
|
|||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.Utf8Appendable;
|
||||
import org.eclipse.jetty.util.component.Dumpable;
|
||||
import org.eclipse.jetty.websocket.core.Behavior;
|
||||
import org.eclipse.jetty.websocket.core.CloseStatus;
|
||||
import org.eclipse.jetty.websocket.core.Configuration;
|
||||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||
import org.eclipse.jetty.websocket.core.IncomingFrames;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.OutgoingFrames;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConstants;
|
||||
import org.eclipse.jetty.websocket.core.exception.CloseException;
|
||||
import org.eclipse.jetty.websocket.core.exception.ProtocolException;
|
||||
import org.eclipse.jetty.websocket.core.exception.WebSocketTimeoutException;
|
||||
import org.eclipse.jetty.websocket.core.exception.WebSocketWriteTimeoutException;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.FrameValidation;
|
||||
import org.eclipse.jetty.websocket.core.internal.FrameFlusher;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketSessionState;
|
||||
import org.eclipse.jetty.websocket.core.util.FragmentingFlusher;
|
||||
import org.eclipse.jetty.websocket.core.util.FrameValidation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -55,7 +46,7 @@ import static org.eclipse.jetty.util.Callback.NOOP;
|
|||
/**
|
||||
* The Core WebSocket Session.
|
||||
*/
|
||||
public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpable
|
||||
public class WebSocketCoreSession implements CoreSession, Dumpable
|
||||
{
|
||||
private static final Logger LOG = LoggerFactory.getLogger(WebSocketCoreSession.class);
|
||||
private static final CloseStatus NO_CODE = new CloseStatus(CloseStatus.NO_CODE);
|
||||
|
@ -172,7 +163,7 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab
|
|||
{
|
||||
writeTimeout = timeout;
|
||||
if (getConnection() != null)
|
||||
getConnection().getFrameFlusher().setIdleTimeout(timeout.toMillis());
|
||||
getConnection().setWriteTimeout(timeout.toMillis());
|
||||
}
|
||||
|
||||
public SocketAddress getLocalAddress()
|
||||
|
@ -202,10 +193,14 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab
|
|||
return sessionState.isClosed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to set the WebSocketConnection on this {@link WebSocketCoreSession}.
|
||||
* @param connection the websocket connection.
|
||||
*/
|
||||
public void setWebSocketConnection(WebSocketConnection connection)
|
||||
{
|
||||
connection.getEndPoint().setIdleTimeout(idleTimeout.toMillis());
|
||||
connection.getFrameFlusher().setIdleTimeout(writeTimeout.toMillis());
|
||||
connection.setWriteTimeout(writeTimeout.toMillis());
|
||||
extensionStack.setLastDemand(connection::demand);
|
||||
this.connection = connection;
|
||||
}
|
||||
|
@ -245,6 +240,9 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab
|
|||
return components.getByteBufferPool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to notify the {@link WebSocketCoreSession} that EOF has been read or the connection has been closed.
|
||||
*/
|
||||
public void onEof()
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
|
@ -377,7 +375,7 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab
|
|||
}
|
||||
|
||||
/**
|
||||
* Open/Activate the session.
|
||||
* Used to notify the {@link WebSocketCoreSession} that the connection has been opened.
|
||||
*/
|
||||
public void onOpen()
|
||||
{
|
||||
|
@ -810,7 +808,7 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab
|
|||
}
|
||||
|
||||
@Override
|
||||
void forwardFrame(Frame frame, Callback callback, boolean batch)
|
||||
protected void forwardFrame(Frame frame, Callback callback, boolean batch)
|
||||
{
|
||||
negotiated.getExtensions().sendFrame(frame, callback, batch);
|
||||
}
|
|
@ -16,7 +16,7 @@ package org.eclipse.jetty.websocket.core.exception;
|
|||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.eclipse.jetty.websocket.core.internal.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.ReflectUtils;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class DuplicateAnnotationException extends InvalidWebSocketException
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.lang.annotation.Annotation;
|
|||
import java.lang.invoke.MethodType;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.eclipse.jetty.websocket.core.internal.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.ReflectUtils;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class InvalidSignatureException extends InvalidWebSocketException
|
||||
|
|
|
@ -23,6 +23,9 @@ import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
|||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.util.DemandChain;
|
||||
import org.eclipse.jetty.websocket.core.util.DemandingFlusher;
|
||||
import org.eclipse.jetty.websocket.core.util.FragmentingFlusher;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -42,7 +45,7 @@ public class FragmentExtension extends AbstractExtension implements DemandChain
|
|||
outgoingFlusher = new FragmentingFlusher(configuration)
|
||||
{
|
||||
@Override
|
||||
void forwardFrame(Frame frame, Callback callback, boolean batch)
|
||||
protected void forwardFrame(Frame frame, Callback callback, boolean batch)
|
||||
{
|
||||
nextOutgoingFrame(frame, callback, batch);
|
||||
}
|
||||
|
|
|
@ -13,14 +13,12 @@
|
|||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.eclipse.jetty.io.ByteBufferPool;
|
||||
import org.eclipse.jetty.io.RetainableByteBuffer;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.core.CloseStatus;
|
||||
import org.eclipse.jetty.websocket.core.Configuration;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
|
@ -87,7 +85,7 @@ public class Parser
|
|||
* @return Frame or null if not enough data for a complete frame.
|
||||
* @throws WebSocketException if unable to parse properly
|
||||
*/
|
||||
public ParsedFrame parse(ByteBuffer buffer) throws WebSocketException
|
||||
public Frame.Parsed parse(ByteBuffer buffer) throws WebSocketException
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -212,7 +210,7 @@ public class Parser
|
|||
{
|
||||
if (aggregate == null)
|
||||
checkFrameSize(OpCode.getOpCode(firstByte), payloadLength);
|
||||
ParsedFrame frame = parsePayload(buffer);
|
||||
Frame.Parsed frame = parsePayload(buffer);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("{} parsed {}", this, frame);
|
||||
return frame;
|
||||
|
@ -265,7 +263,7 @@ public class Parser
|
|||
}
|
||||
}
|
||||
|
||||
protected ParsedFrame newFrame(byte firstByte, byte[] mask, ByteBuffer payload, Runnable releaser)
|
||||
protected Frame.Parsed newFrame(byte firstByte, byte[] mask, ByteBuffer payload, Runnable releaser)
|
||||
{
|
||||
// Validate OpCode
|
||||
byte opcode = OpCode.getOpCode(firstByte);
|
||||
|
@ -277,10 +275,10 @@ public class Parser
|
|||
if (OpCode.isControlFrame(opcode) && !fin)
|
||||
throw new ProtocolException("Fragmented Control Frame [" + OpCode.name(opcode) + "]");
|
||||
|
||||
return new ParsedFrame(firstByte, mask, payload, releaser);
|
||||
return new Frame.Parsed(firstByte, mask, payload, releaser);
|
||||
}
|
||||
|
||||
private ParsedFrame autoFragment(ByteBuffer buffer, int fragmentSize)
|
||||
private Frame.Parsed autoFragment(ByteBuffer buffer, int fragmentSize)
|
||||
{
|
||||
payloadLength -= fragmentSize;
|
||||
|
||||
|
@ -299,14 +297,14 @@ public class Parser
|
|||
content.limit(fragmentSize);
|
||||
buffer.position(buffer.position() + fragmentSize);
|
||||
|
||||
final ParsedFrame frame = newFrame((byte)(firstByte & 0x7F), mask, content, null);
|
||||
final Frame.Parsed frame = newFrame((byte)(firstByte & 0x7F), mask, content, null);
|
||||
mask = nextMask;
|
||||
firstByte = (byte)((firstByte & 0x80) | OpCode.CONTINUATION);
|
||||
state = State.FRAGMENT;
|
||||
return frame;
|
||||
}
|
||||
|
||||
private ParsedFrame parsePayload(ByteBuffer buffer)
|
||||
private Frame.Parsed parsePayload(ByteBuffer buffer)
|
||||
{
|
||||
if (payloadLength == 0)
|
||||
return null;
|
||||
|
@ -340,7 +338,7 @@ public class Parser
|
|||
if (available == payloadLength)
|
||||
{
|
||||
// All the available data is for this frame and completes it
|
||||
ParsedFrame frame = newFrame(firstByte, mask, buffer.slice(), null);
|
||||
Frame.Parsed frame = newFrame(firstByte, mask, buffer.slice(), null);
|
||||
buffer.position(buffer.limit());
|
||||
state = State.START;
|
||||
return frame;
|
||||
|
@ -351,7 +349,7 @@ public class Parser
|
|||
int limit = buffer.limit();
|
||||
int end = buffer.position() + payloadLength;
|
||||
buffer.limit(end);
|
||||
final ParsedFrame frame = newFrame(firstByte, mask, buffer.slice(), null);
|
||||
final Frame.Parsed frame = newFrame(firstByte, mask, buffer.slice(), null);
|
||||
buffer.position(end);
|
||||
buffer.limit(limit);
|
||||
state = State.START;
|
||||
|
@ -398,54 +396,4 @@ public class Parser
|
|||
return String
|
||||
.format("Parser@%x[s=%s,c=%d,o=0x%x,m=%s,l=%d]", hashCode(), state, cursor, firstByte, mask == null ? "-" : StringUtil.toHexString(mask), payloadLength);
|
||||
}
|
||||
|
||||
public static class ParsedFrame extends Frame implements Closeable, CloseStatus.Supplier
|
||||
{
|
||||
final CloseStatus closeStatus;
|
||||
final Runnable releaser;
|
||||
|
||||
public ParsedFrame(byte firstByte, byte[] mask, ByteBuffer payload, Runnable releaser)
|
||||
{
|
||||
super(firstByte, mask, payload);
|
||||
demask();
|
||||
this.releaser = releaser;
|
||||
if (getOpCode() == OpCode.CLOSE)
|
||||
{
|
||||
if (hasPayload())
|
||||
closeStatus = new CloseStatus(payload.duplicate());
|
||||
else
|
||||
closeStatus = CloseStatus.NO_CODE_STATUS;
|
||||
}
|
||||
else
|
||||
{
|
||||
closeStatus = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close()
|
||||
{
|
||||
if (releaser != null)
|
||||
releaser.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloseStatus getCloseStatus()
|
||||
{
|
||||
return closeStatus;
|
||||
}
|
||||
|
||||
public boolean isReleaseable()
|
||||
{
|
||||
return releaser != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (closeStatus == null)
|
||||
return super.toString();
|
||||
return super.toString() + ":" + closeStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,9 @@ import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
|||
import org.eclipse.jetty.websocket.core.exception.BadPayloadException;
|
||||
import org.eclipse.jetty.websocket.core.exception.MessageTooLargeException;
|
||||
import org.eclipse.jetty.websocket.core.exception.ProtocolException;
|
||||
import org.eclipse.jetty.websocket.core.util.DemandChain;
|
||||
import org.eclipse.jetty.websocket.core.util.DemandingFlusher;
|
||||
import org.eclipse.jetty.websocket.core.util.TransformingFlusher;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
|||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.exception.ProtocolException;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.FrameValidation;
|
||||
import org.eclipse.jetty.websocket.core.util.FrameValidation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.util.Objects;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodType;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodType;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.lang.invoke.MethodHandle;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.util.Objects;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.messages;
|
||||
package org.eclipse.jetty.websocket.core.messages;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
|
|
@ -11,11 +11,12 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
package org.eclipse.jetty.websocket.core.util;
|
||||
|
||||
import java.util.function.LongConsumer;
|
||||
|
||||
import org.eclipse.jetty.websocket.core.Extension;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionStack;
|
||||
|
||||
/**
|
||||
* This is extended by an {@link Extension} so it can intercept demand calls.
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
package org.eclipse.jetty.websocket.core.util;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
package org.eclipse.jetty.websocket.core.util;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
|
@ -19,6 +19,7 @@ import org.eclipse.jetty.util.Callback;
|
|||
import org.eclipse.jetty.websocket.core.Configuration;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.internal.FrameEntry;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -39,7 +40,7 @@ public abstract class FragmentingFlusher extends TransformingFlusher
|
|||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
abstract void forwardFrame(Frame frame, Callback callback, boolean batch);
|
||||
protected abstract void forwardFrame(Frame frame, Callback callback, boolean batch);
|
||||
|
||||
@Override
|
||||
protected boolean onFrame(Frame frame, Callback callback, boolean batch)
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.util;
|
||||
package org.eclipse.jetty.websocket.core.util;
|
||||
|
||||
import org.eclipse.jetty.websocket.core.Behavior;
|
||||
import org.eclipse.jetty.websocket.core.CloseStatus;
|
||||
|
@ -21,7 +21,6 @@ import org.eclipse.jetty.websocket.core.OpCode;
|
|||
import org.eclipse.jetty.websocket.core.exception.CloseException;
|
||||
import org.eclipse.jetty.websocket.core.exception.MessageTooLargeException;
|
||||
import org.eclipse.jetty.websocket.core.exception.ProtocolException;
|
||||
import org.eclipse.jetty.websocket.core.internal.Parser;
|
||||
|
||||
/**
|
||||
* Some static utility methods for validating a {@link Frame} based on the state of its {@link CoreSession}.
|
||||
|
@ -61,7 +60,7 @@ public class FrameValidation
|
|||
*/
|
||||
if (frame.getOpCode() == OpCode.CLOSE)
|
||||
{
|
||||
if (!(frame instanceof Parser.ParsedFrame)) // already check in parser
|
||||
if (!(frame instanceof Frame.Parsed)) // already check in parser
|
||||
CloseStatus.getCloseStatus(frame); // return ignored as get used to validate there is a closeStatus
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +81,7 @@ public class FrameValidation
|
|||
*/
|
||||
if (frame.getOpCode() == OpCode.CLOSE)
|
||||
{
|
||||
if (!(frame instanceof Parser.ParsedFrame)) // already check in parser
|
||||
if (!(frame instanceof Frame.Parsed)) // already check in parser
|
||||
{
|
||||
CloseStatus closeStatus = CloseStatus.getCloseStatus(frame);
|
||||
if (!CloseStatus.isTransmittableStatusCode(closeStatus.getCode()) && (closeStatus.getCode() != CloseStatus.NO_CODE))
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.util;
|
||||
package org.eclipse.jetty.websocket.core.util;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.util;
|
||||
package org.eclipse.jetty.websocket.core.util;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.invoke.MethodType;
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal.util;
|
||||
package org.eclipse.jetty.websocket.core.util;
|
||||
|
||||
/**
|
||||
* Collection of utility methods for Text content
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
package org.eclipse.jetty.websocket.core.util;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
|
@ -21,6 +21,7 @@ import org.eclipse.jetty.util.IteratingCallback;
|
|||
import org.eclipse.jetty.util.StaticException;
|
||||
import org.eclipse.jetty.util.thread.AutoLock;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.internal.FrameEntry;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.core.internal;
|
||||
package org.eclipse.jetty.websocket.core.util;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
|
@ -19,7 +19,7 @@ import java.util.Base64;
|
|||
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConstants;
|
||||
|
||||
public final class WebSocketCore
|
||||
public final class WebSocketUtils
|
||||
{
|
||||
|
||||
/**
|
|
@ -33,14 +33,14 @@ import org.eclipse.jetty.util.thread.Scheduler;
|
|||
import org.eclipse.jetty.websocket.core.Behavior;
|
||||
import org.eclipse.jetty.websocket.core.Configuration;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||
import org.eclipse.jetty.websocket.core.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConnection;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConstants;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.exception.WebSocketException;
|
||||
import org.eclipse.jetty.websocket.core.internal.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.internal.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketConnection;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.server.Handshaker;
|
||||
import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -129,8 +129,6 @@ public abstract class AbstractHandshaker implements Handshaker
|
|||
|
||||
connectionMetaData.getConnector().getEventListeners().forEach(connection::addEventListener);
|
||||
|
||||
coreSession.setWebSocketConnection(connection);
|
||||
|
||||
prepareResponse(response, negotiation);
|
||||
if (httpConfig.getSendServerVersion())
|
||||
response.getHeaders().put(SERVER_VERSION);
|
||||
|
@ -190,7 +188,9 @@ public abstract class AbstractHandshaker implements Handshaker
|
|||
|
||||
protected WebSocketConnection newWebSocketConnection(EndPoint endPoint, Executor executor, Scheduler scheduler, ByteBufferPool byteBufferPool, WebSocketCoreSession coreSession)
|
||||
{
|
||||
return new WebSocketConnection(endPoint, executor, scheduler, byteBufferPool, coreSession);
|
||||
WebSocketConnection connection = new WebSocketConnection(endPoint, executor, scheduler, byteBufferPool, coreSession);
|
||||
coreSession.setWebSocketConnection(connection);
|
||||
return connection;
|
||||
}
|
||||
|
||||
protected abstract void prepareResponse(Response response, WebSocketNegotiation negotiation);
|
||||
|
|
|
@ -28,9 +28,9 @@ import org.eclipse.jetty.server.Request;
|
|||
import org.eclipse.jetty.server.Response;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketConnection;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCore;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConnection;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.util.WebSocketUtils;
|
||||
|
||||
public final class RFC6455Handshaker extends AbstractHandshaker
|
||||
{
|
||||
|
@ -80,7 +80,9 @@ public final class RFC6455Handshaker extends AbstractHandshaker
|
|||
ConnectionMetaData connectionMetaData = baseRequest.getConnectionMetaData();
|
||||
Connector connector = connectionMetaData.getConnector();
|
||||
ByteBufferPool byteBufferPool = connector.getByteBufferPool();
|
||||
return newWebSocketConnection(connectionMetaData.getConnection().getEndPoint(), connector.getExecutor(), connector.getScheduler(), byteBufferPool, coreSession);
|
||||
WebSocketConnection connection = newWebSocketConnection(connectionMetaData.getConnection().getEndPoint(), connector.getExecutor(), connector.getScheduler(), byteBufferPool, coreSession);
|
||||
coreSession.setWebSocketConnection(connection);
|
||||
return connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -90,6 +92,6 @@ public final class RFC6455Handshaker extends AbstractHandshaker
|
|||
HttpFields.Mutable responseFields = response.getHeaders();
|
||||
responseFields.put(UPGRADE_WEBSOCKET);
|
||||
responseFields.put(CONNECTION_UPGRADE);
|
||||
responseFields.put(HttpHeader.SEC_WEBSOCKET_ACCEPT, WebSocketCore.hashKey(((RFC6455Negotiation)negotiation).getKey()));
|
||||
responseFields.put(HttpHeader.SEC_WEBSOCKET_ACCEPT, WebSocketUtils.hashKey(((RFC6455Negotiation)negotiation).getKey()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ import org.eclipse.jetty.server.Response;
|
|||
import org.eclipse.jetty.server.TunnelSupport;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketConnection;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketConnection;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketCoreSession;
|
||||
|
||||
public class RFC8441Handshaker extends AbstractHandshaker
|
||||
{
|
||||
|
|
|
@ -16,8 +16,8 @@ package org.eclipse.jetty.websocket.core;
|
|||
import java.util.Base64;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCore;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.core.util.WebSocketUtils;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
@ -29,7 +29,7 @@ public class AcceptHashTest
|
|||
{
|
||||
private static String hexAsKey(String hex)
|
||||
{
|
||||
byte[] key = TypeUtil.fromHexString(hex);
|
||||
byte[] key = StringUtil.fromHexString(hex);
|
||||
assertThat("Key size of hex:[" + hex + "]", key.length, is(16));
|
||||
return Base64.getEncoder().encodeToString(key);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class AcceptHashTest
|
|||
@MethodSource("data")
|
||||
public void testHashKey(String clientKey, String expectedHash)
|
||||
{
|
||||
String serverAccept = WebSocketCore.hashKey(clientKey);
|
||||
String serverAccept = WebSocketUtils.hashKey(clientKey);
|
||||
assertThat("Hashed Key", serverAccept, is(expectedHash));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
package org.eclipse.jetty.websocket.core;
|
||||
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
|
||||
public class DemandingIncomingFramesCapture extends IncomingFramesCapture
|
||||
{
|
||||
|
|
|
@ -19,11 +19,8 @@ import java.util.stream.Stream;
|
|||
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.websocket.core.exception.ProtocolException;
|
||||
import org.eclipse.jetty.websocket.core.internal.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.internal.Generator;
|
||||
import org.eclipse.jetty.websocket.core.internal.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.FrameValidation;
|
||||
import org.eclipse.jetty.websocket.core.util.FrameValidation;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
|
|
@ -25,11 +25,8 @@ import org.eclipse.jetty.util.BufferUtil;
|
|||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.core.exception.ProtocolException;
|
||||
import org.eclipse.jetty.websocket.core.exception.WebSocketException;
|
||||
import org.eclipse.jetty.websocket.core.internal.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.internal.Generator;
|
||||
import org.eclipse.jetty.websocket.core.internal.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.FrameValidation;
|
||||
import org.eclipse.jetty.websocket.core.util.FrameValidation;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Locale;
|
|||
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.core.internal.Generator;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
@ -45,7 +45,7 @@ public class OutgoingNetworkBytesCapture implements OutgoingFrames
|
|||
{
|
||||
assertThat("Capture index does not exist", idx, lessThan(captured.size()));
|
||||
ByteBuffer buf = captured.get(idx);
|
||||
String actualHex = TypeUtil.toHexString(BufferUtil.toArray(buf)).toUpperCase(Locale.ENGLISH);
|
||||
String actualHex = StringUtil.toHexString(BufferUtil.toArray(buf)).toUpperCase(Locale.ENGLISH);
|
||||
assertThat("captured[" + idx + "]", actualHex, is(expectedHex.toUpperCase(Locale.ENGLISH)));
|
||||
}
|
||||
|
||||
|
|
|
@ -18,11 +18,8 @@ import java.util.LinkedList;
|
|||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
|
||||
import org.eclipse.jetty.websocket.core.internal.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.internal.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.internal.Parser;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.FrameValidation;
|
||||
import org.eclipse.jetty.websocket.core.util.FrameValidation;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
|
|
|
@ -23,11 +23,9 @@ import java.util.concurrent.TimeUnit;
|
|||
import org.eclipse.jetty.toolchain.test.Hex;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.websocket.core.exception.MessageTooLargeException;
|
||||
import org.eclipse.jetty.websocket.core.exception.ProtocolException;
|
||||
import org.eclipse.jetty.websocket.core.internal.Generator;
|
||||
import org.eclipse.jetty.websocket.core.internal.Parser;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1497,7 +1495,7 @@ public class ParserTest
|
|||
@Test
|
||||
public void testParseAutobahn793() throws Exception
|
||||
{
|
||||
ByteBuffer buf = BufferUtil.toBuffer(TypeUtil.fromHexString("8882c2887e61c164"));
|
||||
ByteBuffer buf = BufferUtil.toBuffer(StringUtil.fromHexString("8882c2887e61c164"));
|
||||
Exception e = assertThrows(ProtocolException.class, () -> parse(Behavior.SERVER, MAX_ALLOWED_FRAME_SIZE, buf, true));
|
||||
assertThat(e.getMessage(), Matchers.containsString("Invalid CLOSE Code: "));
|
||||
}
|
||||
|
@ -1505,7 +1503,7 @@ public class ParserTest
|
|||
@Test
|
||||
public void testParseAutobahn796() throws Exception
|
||||
{
|
||||
ByteBuffer buf = BufferUtil.toBuffer(TypeUtil.fromHexString("88824c49cb474fbf"));
|
||||
ByteBuffer buf = BufferUtil.toBuffer(StringUtil.fromHexString("88824c49cb474fbf"));
|
||||
ParserCapture capture = parse(Behavior.SERVER, MAX_ALLOWED_FRAME_SIZE, buf, true);
|
||||
|
||||
capture.assertHasFrame(OpCode.CLOSE, 1);
|
||||
|
@ -1523,7 +1521,7 @@ public class ParserTest
|
|||
ParserCapture capture = parse(Behavior.CLIENT, MAX_ALLOWED_FRAME_SIZE, buffer, false);
|
||||
|
||||
capture.assertHasFrame(OpCode.TEXT, 1);
|
||||
Parser.ParsedFrame text = (Parser.ParsedFrame)capture.framesQueue.take();
|
||||
Frame.Parsed text = (Frame.Parsed)capture.framesQueue.take();
|
||||
assertEquals("Hello World", text.getPayloadAsUTF8());
|
||||
assertTrue(text.getPayload().isDirect());
|
||||
assertFalse(text.isReleaseable());
|
||||
|
@ -1538,7 +1536,7 @@ public class ParserTest
|
|||
ParserCapture capture = parse(Behavior.CLIENT, MAX_ALLOWED_FRAME_SIZE, buffer, false);
|
||||
|
||||
capture.assertHasFrame(OpCode.TEXT, 1);
|
||||
Parser.ParsedFrame text = (Parser.ParsedFrame)capture.framesQueue.take();
|
||||
Frame.Parsed text = (Frame.Parsed)capture.framesQueue.take();
|
||||
assertEquals("Hello World", text.getPayloadAsUTF8());
|
||||
assertThat(text.getPayload().array(), sameInstance(buffer.array()));
|
||||
assertFalse(text.isReleaseable());
|
||||
|
@ -1559,7 +1557,7 @@ public class ParserTest
|
|||
capture.parse(buffer);
|
||||
assertEquals(1, capture.framesQueue.size());
|
||||
assertEquals(0, buffer.remaining());
|
||||
Parser.ParsedFrame text = (Parser.ParsedFrame)capture.framesQueue.take();
|
||||
Frame.Parsed text = (Frame.Parsed)capture.framesQueue.take();
|
||||
assertFalse(text.isFin());
|
||||
assertEquals("Hello", text.getPayloadAsUTF8());
|
||||
assertThat(text.getPayload().array(), sameInstance(buffer.array()));
|
||||
|
@ -1570,7 +1568,7 @@ public class ParserTest
|
|||
capture.parse(buffer);
|
||||
assertEquals(1, capture.framesQueue.size());
|
||||
assertEquals(0, buffer.remaining());
|
||||
text = (Parser.ParsedFrame)capture.framesQueue.take();
|
||||
text = (Frame.Parsed)capture.framesQueue.take();
|
||||
assertFalse(text.isFin());
|
||||
assertEquals(" ", text.getPayloadAsUTF8());
|
||||
assertThat(text.getPayload().array(), sameInstance(buffer.array()));
|
||||
|
@ -1582,7 +1580,7 @@ public class ParserTest
|
|||
assertEquals(1, capture.framesQueue.size());
|
||||
assertEquals(0, buffer.remaining());
|
||||
capture.assertHasFrame(OpCode.CONTINUATION, 1);
|
||||
text = (Parser.ParsedFrame)capture.framesQueue.take();
|
||||
text = (Frame.Parsed)capture.framesQueue.take();
|
||||
assertTrue(text.isFin());
|
||||
assertEquals("World", text.getPayloadAsUTF8());
|
||||
assertThat(text.getPayload().array(), sameInstance(buffer.array()));
|
||||
|
@ -1618,7 +1616,7 @@ public class ParserTest
|
|||
assertEquals(0, buffer.remaining());
|
||||
|
||||
capture.assertHasFrame(OpCode.TEXT, 1);
|
||||
Parser.ParsedFrame text = (Parser.ParsedFrame)capture.framesQueue.take();
|
||||
Frame.Parsed text = (Frame.Parsed)capture.framesQueue.take();
|
||||
assertEquals("Hello World", text.getPayloadAsUTF8());
|
||||
assertThat(text.getPayload().array(), not(sameInstance(buffer.array())));
|
||||
assertTrue(text.isReleaseable());
|
||||
|
@ -1652,7 +1650,7 @@ public class ParserTest
|
|||
assertEquals(0, buffer.remaining());
|
||||
|
||||
capture.assertHasFrame(OpCode.PING, 1);
|
||||
Parser.ParsedFrame text = (Parser.ParsedFrame)capture.framesQueue.take();
|
||||
Frame.Parsed text = (Frame.Parsed)capture.framesQueue.take();
|
||||
assertEquals("Hello World", text.getPayloadAsUTF8());
|
||||
assertThat(text.getPayload().array(), not(sameInstance(buffer.array())));
|
||||
assertTrue(text.isReleaseable());
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.eclipse.jetty.util.Callback;
|
|||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||
import org.eclipse.jetty.websocket.core.internal.Generator;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCore;
|
||||
import org.eclipse.jetty.websocket.core.util.WebSocketUtils;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -313,7 +313,7 @@ public class UpgradeWithLeftOverHttpBytesTest extends WebSocketTester
|
|||
assertTrue(matcher.matches());
|
||||
String key = matcher.group(1);
|
||||
assertFalse(StringUtil.isEmpty(key));
|
||||
return WebSocketCore.hashKey(key);
|
||||
return WebSocketUtils.hashKey(key);
|
||||
}
|
||||
|
||||
static String getRequestHeaders(InputStream is)
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.eclipse.jetty.logging.StacklessLogging;
|
|||
import org.eclipse.jetty.util.BlockingArrayQueue;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.nio.ByteBuffer;
|
|||
|
||||
import org.eclipse.jetty.toolchain.test.Hex;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.core.internal.Generator;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -117,8 +117,8 @@ public class WebSocketFrameTest
|
|||
for (int i = 0; i <= 8; i++)
|
||||
{
|
||||
Frame frame = new Frame(OpCode.BINARY);
|
||||
frame.setPayload(TypeUtil.fromHexString("0000FFFF000FFFF0".substring(0, i * 2)));
|
||||
frame.setMask(TypeUtil.fromHexString("FF00FF00"));
|
||||
frame.setPayload(StringUtil.fromHexString("0000FFFF000FFFF0".substring(0, i * 2)));
|
||||
frame.setMask(StringUtil.fromHexString("FF00FF00"));
|
||||
frame.demask();
|
||||
assertEquals("Ff0000FfFf0f00F0".substring(0, i * 2), BufferUtil.toHexString(frame.getPayload()), "len=" + i);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
|||
import org.eclipse.jetty.websocket.core.client.UpgradeListener;
|
||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||
import org.eclipse.jetty.websocket.core.exception.UpgradeException;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest;
|
||||
import org.eclipse.jetty.websocket.core.server.ServerUpgradeResponse;
|
||||
import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator;
|
||||
|
|
|
@ -20,8 +20,6 @@ import java.util.function.BiFunction;
|
|||
|
||||
import org.eclipse.jetty.logging.StacklessLogging;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.websocket.core.internal.Parser;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -74,7 +72,7 @@ public class WebSocketOpenTest extends WebSocketTester
|
|||
s.demand(1);
|
||||
return null;
|
||||
});
|
||||
Parser.ParsedFrame frame = receiveFrame(client.getInputStream());
|
||||
Frame.Parsed frame = receiveFrame(client.getInputStream());
|
||||
assertThat(frame.getPayloadAsUTF8(), is("Hello"));
|
||||
|
||||
client.getOutputStream().write(RawFrameBuilder.buildClose(new CloseStatus(CloseStatus.NORMAL), true));
|
||||
|
@ -104,7 +102,7 @@ public class WebSocketOpenTest extends WebSocketTester
|
|||
assertTrue(serverHandler.closeLatch.await(5, TimeUnit.SECONDS));
|
||||
assertThat(serverHandler.closeStatus.getCode(), is(CloseStatus.SERVER_ERROR));
|
||||
|
||||
Parser.ParsedFrame frame = receiveFrame(client.getInputStream());
|
||||
Frame.Parsed frame = receiveFrame(client.getInputStream());
|
||||
assertThat(frame.getOpCode(), is(OpCode.CLOSE));
|
||||
assertThat(new CloseStatus(frame).getCode(), is(CloseStatus.SERVER_ERROR));
|
||||
}
|
||||
|
@ -120,7 +118,7 @@ public class WebSocketOpenTest extends WebSocketTester
|
|||
return null;
|
||||
});
|
||||
|
||||
Parser.ParsedFrame frame = receiveFrame(client.getInputStream());
|
||||
Frame.Parsed frame = receiveFrame(client.getInputStream());
|
||||
assertThat(frame.getOpCode(), is(OpCode.CLOSE));
|
||||
assertThat(new CloseStatus(frame).getCode(), is(CloseStatus.SHUTDOWN));
|
||||
|
||||
|
@ -155,7 +153,7 @@ public class WebSocketOpenTest extends WebSocketTester
|
|||
|
||||
// Can send while onOpen is active
|
||||
coreSession.sendFrame(new Frame(OpCode.TEXT, "Hello"), NOOP, false);
|
||||
Parser.ParsedFrame frame = receiveFrame(client.getInputStream());
|
||||
Frame.Parsed frame = receiveFrame(client.getInputStream());
|
||||
assertThat(frame.getPayloadAsUTF8(), is("Hello"));
|
||||
|
||||
// Succeeded moves to OPEN state.
|
||||
|
|
|
@ -154,7 +154,7 @@ public class WebSocketTester
|
|||
return client;
|
||||
}
|
||||
|
||||
protected Parser.ParsedFrame receiveFrame(InputStream in) throws IOException
|
||||
protected Frame.Parsed receiveFrame(InputStream in) throws IOException
|
||||
{
|
||||
if (buffer == null)
|
||||
buffer = bufferPool.acquire(4096, false);
|
||||
|
@ -162,7 +162,7 @@ public class WebSocketTester
|
|||
while (true)
|
||||
{
|
||||
ByteBuffer byteBuffer = buffer.getByteBuffer();
|
||||
Parser.ParsedFrame frame = parser.parse(byteBuffer);
|
||||
Frame.Parsed frame = parser.parse(byteBuffer);
|
||||
if (!byteBuffer.hasRemaining())
|
||||
BufferUtil.clear(byteBuffer);
|
||||
if (frame != null)
|
||||
|
|
|
@ -23,8 +23,8 @@ import org.eclipse.jetty.websocket.core.CoreSession;
|
|||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.TestFrameHandler;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketServer;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
|
|
@ -19,12 +19,12 @@ import java.util.List;
|
|||
import org.eclipse.jetty.websocket.core.Behavior;
|
||||
import org.eclipse.jetty.websocket.core.Extension;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.IncomingFrames;
|
||||
import org.eclipse.jetty.websocket.core.IncomingFramesCapture;
|
||||
import org.eclipse.jetty.websocket.core.OutgoingFrames;
|
||||
import org.eclipse.jetty.websocket.core.OutgoingFramesCapture;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.internal.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.internal.IdentityExtension;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
|
|
@ -22,19 +22,19 @@ import org.eclipse.jetty.io.ArrayByteBufferPool;
|
|||
import org.eclipse.jetty.toolchain.test.ByteBufferAssert;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.FutureCallback;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.core.Behavior;
|
||||
import org.eclipse.jetty.websocket.core.Extension;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.IncomingFramesCapture;
|
||||
import org.eclipse.jetty.websocket.core.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.TestMessageHandler;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.internal.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.internal.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.internal.Parser;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.hamcrest.Matchers;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class ExtensionTool
|
|||
for (int i = 0; i < parts; i++)
|
||||
{
|
||||
String hex = rawhex[i].replaceAll("\\s*(0x)?", "");
|
||||
net = TypeUtil.fromHexString(hex);
|
||||
net = StringUtil.fromHexString(hex);
|
||||
|
||||
ByteBuffer buffer = ByteBuffer.wrap(net);
|
||||
while (BufferUtil.hasContent(buffer))
|
||||
|
|
|
@ -29,15 +29,15 @@ import org.eclipse.jetty.websocket.core.Behavior;
|
|||
import org.eclipse.jetty.websocket.core.Configuration;
|
||||
import org.eclipse.jetty.websocket.core.DemandingIncomingFramesCapture;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.IncomingFramesCapture;
|
||||
import org.eclipse.jetty.websocket.core.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.OutgoingFramesCapture;
|
||||
import org.eclipse.jetty.websocket.core.TestMessageHandler;
|
||||
import org.eclipse.jetty.websocket.core.internal.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.internal.FragmentExtension;
|
||||
import org.eclipse.jetty.websocket.core.internal.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
|
|
@ -24,21 +24,21 @@ import java.util.concurrent.TimeUnit;
|
|||
import org.eclipse.jetty.toolchain.test.ByteBufferAssert;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.core.Behavior;
|
||||
import org.eclipse.jetty.websocket.core.Configuration.ConfigurationCustomizer;
|
||||
import org.eclipse.jetty.websocket.core.DemandingIncomingFramesCapture;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.IncomingFramesCapture;
|
||||
import org.eclipse.jetty.websocket.core.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.OutgoingFramesCapture;
|
||||
import org.eclipse.jetty.websocket.core.TestMessageHandler;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.exception.ProtocolException;
|
||||
import org.eclipse.jetty.websocket.core.internal.ExtensionStack;
|
||||
import org.eclipse.jetty.websocket.core.internal.Negotiated;
|
||||
import org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
@ -60,7 +60,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
|
|||
|
||||
private void assertEndsWithTail(String hexStr, boolean expectedResult)
|
||||
{
|
||||
ByteBuffer buf = ByteBuffer.wrap(TypeUtil.fromHexString(hexStr));
|
||||
ByteBuffer buf = ByteBuffer.wrap(StringUtil.fromHexString(hexStr));
|
||||
assertThat("endsWithTail([" + hexStr + "])", PerMessageDeflateExtension.endsWithTail(buf), is(expectedResult));
|
||||
}
|
||||
|
||||
|
|
|
@ -250,7 +250,7 @@ public class FrameFlusherTest
|
|||
{
|
||||
for (ByteBuffer buffer : buffers)
|
||||
{
|
||||
Parser.ParsedFrame frame = parser.parse(buffer);
|
||||
Frame.Parsed frame = parser.parse(buffer);
|
||||
if (frame != null)
|
||||
{
|
||||
incomingFrames.offer(frame);
|
||||
|
|
|
@ -39,9 +39,9 @@ import org.eclipse.jetty.websocket.core.FrameHandler;
|
|||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.TestAsyncFrameHandler;
|
||||
import org.eclipse.jetty.websocket.core.TestWebSocketNegotiator;
|
||||
import org.eclipse.jetty.websocket.core.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.client.CoreClientUpgradeRequest;
|
||||
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
|
||||
import org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession;
|
||||
import org.eclipse.jetty.websocket.core.server.ServerUpgradeRequest;
|
||||
import org.eclipse.jetty.websocket.core.server.ServerUpgradeResponse;
|
||||
import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator;
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.eclipse.jetty.util.IO;
|
|||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageReader;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageReader;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.jetty.util.Utf8StringBuilder;
|
|||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageWriter;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageWriter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.eclipse.jetty.util.Utf8Appendable;
|
|||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.PartialStringMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.PartialStringMessageSink;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.jetty.websocket.core.CoreSession;
|
|||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.exception.MessageTooLargeException;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.StringMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.StringMessageSink;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
|
|
@ -43,8 +43,8 @@ import jakarta.websocket.server.ServerEndpointConfig;
|
|||
import org.eclipse.jetty.ee10.cdi.CdiDecoratingListener;
|
||||
import org.eclipse.jetty.ee10.cdi.CdiServletContainerInitializer;
|
||||
import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketClientContainer;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketClientContainerProvider;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.internal.JakartaWebSocketClientContainer;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer.Configurator;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
|
|
|
@ -13,20 +13,17 @@
|
|||
|
||||
module org.eclipse.jetty.ee10.websocket.jakarta.client
|
||||
{
|
||||
requires org.eclipse.jetty.websocket.core.client;
|
||||
requires org.eclipse.jetty.ee10.websocket.jakarta.common;
|
||||
requires org.slf4j;
|
||||
|
||||
requires transitive jakarta.websocket;
|
||||
requires transitive org.eclipse.jetty.client;
|
||||
requires transitive org.eclipse.jetty.ee10.websocket.jakarta.common;
|
||||
|
||||
requires static jakarta.servlet;
|
||||
requires static jakarta.servlet;
|
||||
|
||||
exports org.eclipse.jetty.ee10.websocket.jakarta.client;
|
||||
|
||||
exports org.eclipse.jetty.ee10.websocket.jakarta.client.internal to
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.server;
|
||||
|
||||
provides jakarta.websocket.ContainerProvider with
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketClientContainerProvider;
|
||||
|
||||
provides jakarta.servlet.ServletContainerInitializer with
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.client.internal.JakartaWebSocketShutdownContainer;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.ee10.websocket.jakarta.client.internal;
|
||||
package org.eclipse.jetty.ee10.websocket.jakarta.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
|
@ -33,6 +33,10 @@ import jakarta.websocket.EndpointConfig;
|
|||
import jakarta.websocket.Extension;
|
||||
import jakarta.websocket.Session;
|
||||
import org.eclipse.jetty.client.HttpClient;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.internal.AnnotatedClientEndpointConfig;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.internal.BasicClientEndpointConfig;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.internal.JakartaClientUpgradeRequest;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.internal.JsrUpgradeListener;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.ConfiguredEndpoint;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketContainer;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketExtensionConfig;
|
|
@ -16,7 +16,6 @@ package org.eclipse.jetty.ee10.websocket.jakarta.client;
|
|||
import jakarta.websocket.ContainerProvider;
|
||||
import jakarta.websocket.WebSocketContainer;
|
||||
import org.eclipse.jetty.client.HttpClient;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.internal.JakartaWebSocketClientContainer;
|
||||
import org.eclipse.jetty.util.component.LifeCycle;
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,14 +11,15 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.ee10.websocket.jakarta.client.internal;
|
||||
package org.eclipse.jetty.ee10.websocket.jakarta.client;
|
||||
|
||||
import jakarta.websocket.ClientEndpoint;
|
||||
import jakarta.websocket.EndpointConfig;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.internal.BasicClientEndpointConfig;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketContainer;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketFrameHandlerFactory;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketFrameHandlerMetadata;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.InvokerUtils;
|
||||
|
||||
public class JakartaWebSocketClientFrameHandlerFactory extends JakartaWebSocketFrameHandlerFactory
|
||||
{
|
|
@ -16,6 +16,7 @@ package org.eclipse.jetty.ee10.websocket.jakarta.client.internal;
|
|||
import java.net.URI;
|
||||
import java.security.Principal;
|
||||
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketClientContainer;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketFrameHandler;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.UpgradeRequest;
|
||||
import org.eclipse.jetty.websocket.core.FrameHandler;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.ee10.websocket.jakarta.client;
|
||||
package org.eclipse.jetty.ee10.websocket.jakarta.client.internal;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -20,7 +20,7 @@ import jakarta.servlet.ServletContext;
|
|||
import jakarta.servlet.ServletContextEvent;
|
||||
import jakarta.servlet.ServletContextListener;
|
||||
import jakarta.servlet.ServletException;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.internal.JakartaWebSocketClientContainer;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketClientContainer;
|
||||
import org.eclipse.jetty.util.component.ContainerLifeCycle;
|
||||
import org.eclipse.jetty.util.component.LifeCycle;
|
||||
import org.slf4j.Logger;
|
|
@ -1 +1 @@
|
|||
org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketShutdownContainer
|
||||
org.eclipse.jetty.ee10.websocket.jakarta.client.internal.JakartaWebSocketShutdownContainer
|
||||
|
|
|
@ -26,9 +26,9 @@ import org.eclipse.jetty.util.FutureCallback;
|
|||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageOutputStream;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageWriter;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.TextUtils;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageOutputStream;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageWriter;
|
||||
import org.eclipse.jetty.websocket.core.util.TextUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.eclipse.jetty.util.FutureCallback;
|
|||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.TextUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.TextUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -46,11 +46,11 @@ import org.eclipse.jetty.websocket.core.FrameHandler;
|
|||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.exception.ProtocolException;
|
||||
import org.eclipse.jetty.websocket.core.exception.WebSocketException;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.PartialByteArrayMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.PartialByteBufferMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.PartialStringMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.PartialByteArrayMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.PartialByteBufferMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.PartialStringMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.util.InvokerUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -47,12 +47,12 @@ import org.eclipse.jetty.websocket.core.CoreSession;
|
|||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.exception.InvalidSignatureException;
|
||||
import org.eclipse.jetty.websocket.core.exception.InvalidWebSocketException;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.PartialByteArrayMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.PartialByteBufferMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.PartialStringMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.PartialByteArrayMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.PartialByteBufferMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.PartialStringMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.ReflectUtils;
|
||||
|
||||
public abstract class JakartaWebSocketFrameHandlerFactory
|
||||
{
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.lang.invoke.MethodHandle;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.decoders.RegisteredDecoder;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageSink;
|
||||
|
||||
public class JakartaWebSocketMessageMetadata
|
||||
{
|
||||
|
|
|
@ -28,8 +28,8 @@ import org.eclipse.jetty.websocket.core.Frame;
|
|||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.OutgoingFrames;
|
||||
import org.eclipse.jetty.websocket.core.exception.WebSocketException;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageOutputStream;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageWriter;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageOutputStream;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageWriter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.eclipse.jetty.ee10.websocket.jakarta.common.encoders.AvailableEncoder
|
|||
import org.eclipse.jetty.util.Callback;
|
||||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.ExtensionConfig;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.ReflectUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import jakarta.websocket.EndpointConfig;
|
|||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.exception.InvalidSignatureException;
|
||||
import org.eclipse.jetty.websocket.core.exception.InvalidWebSocketException;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.ReflectUtils;
|
||||
|
||||
public class AvailableDecoders implements Iterable<RegisteredDecoder>, Closeable
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.eclipse.jetty.ee10.websocket.jakarta.common.InitException;
|
|||
import org.eclipse.jetty.websocket.core.WebSocketComponents;
|
||||
import org.eclipse.jetty.websocket.core.exception.InvalidSignatureException;
|
||||
import org.eclipse.jetty.websocket.core.exception.InvalidWebSocketException;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.ReflectUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.eclipse.jetty.util.Callback;
|
|||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.exception.CloseException;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageSink;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketFrameHand
|
|||
import org.eclipse.jetty.ee10.websocket.jakarta.common.decoders.RegisteredDecoder;
|
||||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.exception.CloseException;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.ByteBufferMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.ByteBufferMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageSink;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketFrameHand
|
|||
import org.eclipse.jetty.ee10.websocket.jakarta.common.decoders.RegisteredDecoder;
|
||||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.exception.CloseException;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.InputStreamMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.InputStreamMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageSink;
|
||||
|
||||
public class DecodedBinaryStreamMessageSink<T> extends AbstractDecodedMessageSink.Stream<Decoder.BinaryStream<T>>
|
||||
{
|
||||
|
|
|
@ -24,8 +24,8 @@ import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketFrameHand
|
|||
import org.eclipse.jetty.ee10.websocket.jakarta.common.decoders.RegisteredDecoder;
|
||||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.exception.CloseException;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.StringMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.StringMessageSink;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketFrameHand
|
|||
import org.eclipse.jetty.ee10.websocket.jakarta.common.decoders.RegisteredDecoder;
|
||||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.exception.CloseException;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.ReaderMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.ReaderMessageSink;
|
||||
|
||||
public class DecodedTextStreamMessageSink<T> extends AbstractDecodedMessageSink.Stream<Decoder.TextStream<T>>
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ package org.eclipse.jetty.ee10.websocket.jakarta.common;
|
|||
import jakarta.websocket.ClientEndpoint;
|
||||
import jakarta.websocket.ClientEndpointConfig;
|
||||
import jakarta.websocket.EndpointConfig;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.InvokerUtils;
|
||||
|
||||
public class DummyFrameHandlerFactory extends JakartaWebSocketFrameHandlerFactory
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.eclipse.jetty.util.FutureCallback;
|
|||
import org.eclipse.jetty.util.IO;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.InputStreamMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.InputStreamMessageSink;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.eclipse.jetty.util.Utf8StringBuilder;
|
|||
import org.eclipse.jetty.websocket.core.CoreSession;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.MessageWriter;
|
||||
import org.eclipse.jetty.websocket.core.messages.MessageWriter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.jetty.util.FutureCallback;
|
|||
import org.eclipse.jetty.util.IO;
|
||||
import org.eclipse.jetty.websocket.core.Frame;
|
||||
import org.eclipse.jetty.websocket.core.OpCode;
|
||||
import org.eclipse.jetty.websocket.core.internal.messages.ReaderMessageSink;
|
||||
import org.eclipse.jetty.websocket.core.messages.ReaderMessageSink;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
|
|
@ -22,8 +22,8 @@ import java.util.Map;
|
|||
import jakarta.websocket.Session;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.common.JakartaWebSocketFrameHandlerFactory;
|
||||
import org.eclipse.jetty.util.annotation.Name;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.ReflectUtils;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
|
|
@ -19,8 +19,8 @@ import java.lang.invoke.MethodHandles;
|
|||
import java.lang.reflect.Method;
|
||||
|
||||
import org.eclipse.jetty.util.annotation.Name;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.ReflectUtils;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.lang.annotation.Annotation;
|
|||
import java.lang.reflect.Method;
|
||||
|
||||
import org.eclipse.jetty.util.annotation.Name;
|
||||
import org.eclipse.jetty.websocket.core.internal.util.InvokerUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.InvokerUtils;
|
||||
|
||||
/**
|
||||
* Simple {@link InvokerUtils.ParamIdentifier}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
package org.eclipse.jetty.ee10.websocket.jakarta.common.util;
|
||||
|
||||
import org.eclipse.jetty.websocket.core.internal.util.ReflectUtils;
|
||||
import org.eclipse.jetty.websocket.core.util.ReflectUtils;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
module org.eclipse.jetty.ee10.websocket.jakarta.server
|
||||
{
|
||||
requires org.eclipse.jetty.websocket.core.server;
|
||||
requires org.eclipse.jetty.ee10.websocket.jakarta.common;
|
||||
requires org.eclipse.jetty.ee10.websocket.servlet;
|
||||
requires org.slf4j;
|
||||
|
||||
|
|
|
@ -35,6 +35,6 @@ public class JakartaWebSocketConfiguration extends AbstractConfiguration
|
|||
protectAndExpose("org.eclipse.jetty.ee10.websocket.servlet."); // For WebSocketUpgradeFilter
|
||||
protectAndExpose("org.eclipse.jetty.ee10.websocket.jakarta.server.config.");
|
||||
protectAndExpose("org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketClientContainerProvider");
|
||||
protectAndExpose("org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketShutdownContainer");
|
||||
protectAndExpose("org.eclipse.jetty.ee10.websocket.jakarta.client.internal.JakartaWebSocketShutdownContainer");
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue