Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break out WebSocket core features into new websocket-core components #3055

Merged
merged 357 commits into from
Nov 2, 2018

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Nov 1, 2018

A major refactor of websocket to be based around a core implementation

joakime and others added 30 commits February 8, 2018 11:55
…websocket

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	Jenkinsfile
#	jetty-util/src/main/java/org/eclipse/jetty/util/BufferUtil.java
#	jetty-websocket/javax-websocket-client-impl/pom.xml
#	jetty-websocket/javax-websocket-server-impl/pom.xml
#	jetty-websocket/websocket-api/pom.xml
#	jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java
#	jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketRemoteEndpoint.java
#	jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java
#	jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/extensions/AbstractExtension.java
#	jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/NativeWebSocketConfiguration.java
#	jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java
#	jetty-websocket/websocket-tests/src/main/java/org/eclipse/jetty/websocket/tests/LocalWebSocketConnection.java
…websocket

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	Jenkinsfile
#	jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java
#	jetty-websocket/javax-websocket-server-impl/pom.xml
#	jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/AnnotatedServerEndpointConfig.java
#	jetty-websocket/websocket-api/pom.xml
#	jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/extensions/WebSocketExtensionFactory.java
#	jetty-websocket/websocket-server/pom.xml
#	jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/NativeWebSocketConfiguration.java
#	jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java
#	jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/ServletUpgradeRequest.java
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
I think this test is trying to use QuotedCSV in the wrong way, as it often is offering values when it should be testing parameters.
I have added some examples to show that QuotedCSV is capable of handling the quotes, spaces and embedded commas of the tests, but only
for parameters and not for values.   The question is, is this sufficient for websocket?

Signed-off-by: Greg Wilkins <gregw@webtide.com>
The handling of a Close Frame may close the endpoint, so parsing should not continue

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
lachlan-roberts and others added 15 commits October 24, 2018 14:53
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
CookiesTest.testCookiesAreSentToClient was failing due to the
Assertion being caught and logged by the upgrade request

the response is now captured by a FuturePromise and the assertions are
done in the main test

the reason the assertion was failing was due to lowercase "set-cookie"
instead of "Set-Cookie"

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
Jetty 10.0.x Websocket Reimport

This is a reimport of the refactored websockets for jetty10 (intended to replace the current implementation from jetty9). The work is based on the jetty-10.0.x-websocket branch and refined and completed the work started there, and thus is not as large a contribution as it may appear from the change count.

This contribution is entirely from myself (@lachlan-roberts who has singed the Eclipse ECA for the jetty project), and eclipse jetty committers: @gregw, @joakime and @sbordet.

The protocol elements of a websocket connection have been reworked into the websocket-core module. The jetty and javax API websocket modules are now implemented using the websocket-core.

This PR passes the websocket tests and autobahn testsuite, but should be considered a work in progress that needs further testing within the main jetty repository and development process.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw gregw requested a review from joakime November 1, 2018 19:55
@gregw
Copy link
Contributor Author

gregw commented Nov 1, 2018

This PR is for the technical review before merging back to 10.0.x

@@ -795,6 +795,19 @@ public URI toURI() throws URISyntaxException
return new URI(_scheme,null,_host,_port,_path,_query==null?null:UrlEncoded.decodeString(_query),_fragment);
}

/* ------------------------------------------------------------ */
public URI asURI()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this? isn't the existing toURI() sufficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the checked exception from toURI

// Bad URI (no scheme, no host, no path)
Arguments.of("//",null,null,null,null,null,null,null),
// Bad URI (no scheme, no host, no path)
// Arguments.of("//",null,null,null,null,null,null,null),
Copy link
Contributor

@joakime joakime Nov 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this one to the HttpURI testcase of "Bad" URIs?

}

/* ------------------------------------------------------------ */
/** Append bytes to a buffer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a copy/paste flub.
Perhaps it should be "Append String UTF-8 bytes to a buffer" ?

Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments here and there.
Also some change are candidates for backport to jetty-9.4.x (changes outside /jetty-websocket/)
The rest looks good to me.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw gregw merged commit 9003a0f into jetty-10.0.x Nov 2, 2018
@gregw gregw deleted the jetty-10.0.x-websocket-core-reimport branch November 2, 2018 12:07
@joakime joakime changed the title Jetty 10.0.x websocket refactor Break out WebSocket core features into new websocket-core components Dec 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants