Commit Graph

741 Commits

Author SHA1 Message Date
Greg Wilkins bde86467f4
Issue #3806 - Make Async sendError fully Async (#3912)
* Issue #3806 async sendError

Avoid using isHandled as a test withing sendError as this can be
called asynchronously and is in a race with the normal dispatch of the
request, which could also be setting handled status.

The ErrorHandler was dispatching directly to a context from within
sendError.  This meant that an async thread can call sendError and be
dispatched to within the servlet container at the same time that the
original thread was still dispatched to the container.

This commit fixes that problem by using an async dispatch for error
pages within the ErrorHandler.  However, this introduces a new problem
that a well behaved async app will call complete after calling
sendError.  Thus we have ignore complete ISEs for the remainder of
the current async cycle.

Fixed the closing of the output after calling sendError. Do not
close if the request was async (and thus might be dispatched to an
async error) or if it is now async because the error page itself is
async.

* updates from review
* better tests
* revert ignore complete
* added some TODOs
* more TODOs
* fixed rename
* cleanup ISE and more TODOs
* refactored to call sendError for uncaught exceptions rather than onError
* more of the refactor
* extra tests for sendError from completing state

Reworked HttpChannelState and sendError so that sendError is now
just a change of state. All the work is done in the ErrorDispatch
action, including calling the ErrorHandler.  Async not yet working.

Additional tests

Converted ERRORED state to a separate boolean so it can be used for
both Sync and Async dispatches.

Removed ASYNC_IO state as it was just the same as DISPATCHED

The async onError listener handling is now most likely broken.


WIP making sendError simpler and more tests pass
WIP handling async and thrown exceptions
WIP passing tests

Improved thread handling

removed bad test

Implemented error dispatch on complete properly
more fixed tests

sendError state looks committed

- Added resetContent method to leave more non-content headers during sendError
- Fixed security tests
- simplified the non dispatch error page writing.  Moved towards being able to write async

* fixed gzipHandlerTest

* Updated handling of timeout errors.  According to servlet spec,
exceptions thrown from onTimeout should not be passed to onError, but
just logged and ignored:

   If an exception is thrown while invoking methods in an AsyncListener,
   it is logged and will not affect the invocation of any other AsyncListeners.

* This changes several tests.

* Dispatcher/ContextHandler changes for new ERROR dispatch handling. Feels a bit fragile!

* Fixed tests in jetty-servlets
* Fixed tests in jetty-proxy

* more test fixes

* Fixed head handling
reverted unnecessary changes
Improved reason handling

WIP on fully async error handling.
Simplified HttpChannelState state machines to allow for async actions
during completing

more WIP on fully async error handling.

sendError and completion are not both non-blocking, without using
a startAsync operation. However we are lacking unit tests that actually
exercise those code paths.

* Simplified name of states
Added test for async completion
* Cleanups and javadoc
* Cleanups and javadoc
* remove snake case
* feedback from review
* Write error page into fixed pooled buffer

Use the response to get/release a pooled buffer into which the error
page can be written.  Make it a fixed sized buffer and if it overflows
then no error page is generated (first overflow turns off showstacks
to save space).

The ErrorHandler badly needs to be refactored, but we cannot change
API in jetty-9

* More test fixes for different error page format
* minor cleanups
* Cleanup from Review
* Fixed javadoc
* cleanups and simplifications
* Cleanup from Review
* renaming and some TODOs
* Cleanup from Review
* Checkstyle fixes
* Cleanup from Review
* Code cleanups and simplifications
* fixed debug
* Cleanup from Review
* Ensure response sent before server shutdown
* removed unnecessary optimisation
* fixed duplicate from merge
* Updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-26 17:55:58 +10:00
olivier lamy a36af67abf Merge branch 'jetty-9.4.x' into jetty-10.0.x 2019-08-22 20:45:57 +10:00
Olivier Lamy fe3d3f7158
fix checkstyle in test sources (#4013)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-08-22 19:56:41 +10:00
Joakim Erdfelt f1efc99918 Updating to version 9.4.21-SNAPSHOT 2019-08-13 17:34:20 -05:00
Joakim Erdfelt 84700530e6 Updating to version 9.4.20.v20190813 2019-08-13 16:13:21 -05:00
Simone Bordet a700907522
Issue #250 - Implement HTTP CONNECT for HTTP/2. (#3539)
Fixes #250 - Implement HTTP CONNECT for HTTP/2.

Modified HTTP/2 implementation to support the CONNECT method.
Implemented semantic defined by RFC 8441.
Implemented section 8.3 of RFC 7540.
Introduced HTTP2Client.streamIdleTimeout.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-13 19:07:04 +03:00
olivier lamy 6df9ef3a15 Updating to version 10.0.0-SNAPSHOT 2019-07-12 06:54:56 +10:00
olivier lamy 8cbfd51e80 Updating to version 10.0.0-alpha0 2019-07-12 06:54:56 +10:00
olivier lamy a34e641a27 Updating to version 10.0.0-SNAPSHOT 2019-07-11 17:20:27 +10:00
olivier lamy 2e58f2f515 Updating to version 10.0.0-alpha0 2019-07-11 14:19:45 +10:00
Greg Wilkins d744d097de
Checkstyle cleanup (#3847)
* Checkstyle cleanup
* fixed bug from reformat
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-07-03 17:24:08 +02:00
Greg Wilkins b7a7a53a18
Jetty 10.0.x reformat (#3812)
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Removing Legacy Method Separators
* Restyling branch `jetty-10.0.x`
* Applying checkstyle changes
* Applying checkstyle changes
* Applying XML restyling
* Restyling XML in branch `jetty-10.0.x`
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Fixing XML restyling in branch `jetty-10.0.x`
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Revert "Restyling XML in branch `jetty-10.0.x`"

# Conflicts:
#	jetty-xml/src/test/resources/org/eclipse/jetty/xml/configureWithAttr.xml
#	jetty-xml/src/test/resources/org/eclipse/jetty/xml/configureWithElements.xml

* Adding back build-resources
* Reformatting pom.xml files
* Disabling Checkstyle job
* fixed empty string on line wrap
* reformatted with latest intellij style
* misc checkstyle fixes

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-24 17:42:39 +02:00
Greg Wilkins 9706d70484
Jetty 9.4.x reformat (#3811)
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Applying XML restyling
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Reformatting pom.xml files
* Fixed empty string from line wraps
* Update intellij style to not do expression relative formatting. Reformatted code based on that.
* Increasing line split on Eclipse IDE Formatter to 512
* Restoring setting on internal default value.
+ IntelliJ will not export settings on things that set to their
  internal default values.
  We want to keep those values as a hedge against future default
  value changes in future releases of IntelliJ.
* Fixing intellij codestyle
* do not allow single line simple methods
* misc checkstyle fixes
* re-exported with correct name and all values

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-24 17:40:30 +02:00
Greg Wilkins 343cf732b9
Issue #3789 XmlConfiguration Set Property (#3790)
Issue #3789 XmlConfiguration Set Property

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-21 21:04:53 +02:00
Joakim Erdfelt 60d8661890 Merge `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java
#	jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebInfConfiguration.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/QuotedCSVTest.java
#	jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyWebAppContext.java
#	jetty-nosql/src/main/java/org/eclipse/jetty/nosql/mongodb/MongoSessionDataStore.java
#	jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java
#	jetty-util/src/main/java/org/eclipse/jetty/util/StringUtil.java
#	jetty-util/src/test/java/org/eclipse/jetty/util/StringUtilTest.java
#	jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java
#	jetty-websocket/javax-websocket-tests/src/main/java/org/eclipse/jetty/websocket/javax/tests/WSServer.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WSServer.java
#	tests/test-integration/src/test/java/org/eclipse/jetty/test/support/XmlBasedJettyServer.java
2019-06-13 14:14:42 -05:00
Joakim Erdfelt 40e9e053b9
Merge pull request #3768 from eclipse/jetty-9.4.x-3708-stringutil-replace
Issue #3708 - use StringUtil alternatives for known slow JVM impls.
2019-06-13 14:01:35 -05:00
Joakim Erdfelt 877815e195 Issue #3708 - Adding new methods and converting codebase to use them
+ StringUtil.replace(String, char, char)
+ StringUtil.strip(String, String)
+ URIUtil.encodeSpecific(String, String)
+ URIUtil.decodeSpecific(String, String)
+ TypeUtil.toClassReference(Class)
+ TypeUtil.toClassReference(String)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-12 09:56:41 -05:00
Joakim Erdfelt 33fe55c339 Issue #3708 - use StringUtil alternatives for known slow JVM impls.
+ StringUtil.replace()
+ StringUtil.replaceFirst()
+ StringUtil.sanitizeFileSystemPath()

Change existing usages of String.replace() to either
use new StringUtil.replace() or other methods elsewhere
that better suit that specific need.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-11 11:25:50 -05:00
Joakim Erdfelt ae21126cad Updating to version 9.4.20-SNAPSHOT 2019-06-10 13:40:17 -05:00
Joakim Erdfelt afcf563148 Updating to version 9.4.19.v20190610 2019-06-10 11:17:56 -05:00
Simone Bordet 826d68e80a Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-06-10 11:41:47 +02:00
Greg Wilkins b0bc9c9200 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-05-17 16:47:45 +02:00
Joakim Erdfelt b44ecc932a Issue #2909 - Replace B64Code with java.util.Base64
+ Deprecated B64Code
+ All code that isn't B64CodeTest is now using java.util.Base64
+ B64CodeTest is updated to confirm change to java.util.Base64
  is possible without change in behavior. Just have to make
  sure you use the appropriate Encoder / Decoder for the task
  at hand (default vs mime vs url)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-05-15 10:08:11 +02:00
Joakim Erdfelt a305660c54 Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-server/src/main/config/etc/jetty-ssl-context.xml
#	jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java
#	jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
#	jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/WebSocketClient.java
#	jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java
2019-05-07 13:54:27 -05:00
Gary Gregory 8155942344 Allow subclasses to map exceptions to status codes.
Signed-off-by: Gary Gregory <garydgregory@gmail.com>
2019-05-07 09:59:09 -04:00
Joakim Erdfelt 52bb963186 Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	aggregates/jetty-all-compact3/pom.xml
#	jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
#	jetty-deploy/src/test/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBindingTest.java
#	jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java
#	jetty-http2/http2-alpn-tests/pom.xml
#	jetty-http2/http2-http-client-transport/pom.xml
#	jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java
#	jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ConnectHandlerTest.java
#	jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java
#	jetty-server/src/test/java/org/eclipse/jetty/server/ProxyConnectionTest.java
#	jetty-servlet/src/test/java/org/eclipse/jetty/servlet/AsyncContextTest.java
#	jetty-servlet/src/test/java/org/eclipse/jetty/servlet/ErrorPageTest.java
#	jetty-servlets/src/test/java/org/eclipse/jetty/servlets/CrossOriginFilterTest.java
#	jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipDefaultTest.java
#	jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipTester.java
#	jetty-servlets/src/test/java/org/eclipse/jetty/servlets/HeaderFilterTest.java
#	jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PutFilterTest.java
#	jetty-util/src/test/java/org/eclipse/jetty/util/BufferUtilTest.java
#	jetty-util/src/test/java/org/eclipse/jetty/util/resource/ResourceCollectionTest.java
#	jetty-websocket/javax-websocket-client-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/DecoderReaderManySmallTest.java
#	jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/DelayedStartClientOnServerTest.java
#	jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/DelayedStartClientTest.java
#	jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/AltFilterTest.java
#	jetty-websocket/jetty-websocket-client/src/test/java/org/eclipse/jetty/websocket/client/HttpClientInitTest.java
#	jetty-websocket/jetty-websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/client/ClientCloseTest.java
#	jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/extensions/compress/ByteAccumulatorTest.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WSServer.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketServerFactoryTest.java
#	jetty-xml/src/test/java/org/eclipse/jetty/xml/XmlConfigurationTest.java
#	pom.xml
#	tests/jetty-http-tools/src/main/java/org/eclipse/jetty/http/tools/matchers/HttpFieldsMatchers.java
#	tests/test-http-client-transport/pom.xml
#	tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ServerTimeoutsTest.java
#	tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTesterTest.java
2019-05-01 15:02:31 -05:00
Joakim Erdfelt e33dfabba9 Moving to IPv6 Assumption (from junit Group/Tag)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-30 12:26:14 -05:00
Joakim Erdfelt 734be56938 Updating to version 9.4.19-SNAPSHOT 2019-04-29 16:27:23 -05:00
Joakim Erdfelt e1bc35120a Updating to version 9.4.18.v20190429 2019-04-29 15:40:33 -05:00
Joakim Erdfelt 05bb111580 Updating to version 9.4.18-SNAPSHOT 2019-04-18 15:59:49 -05:00
Joakim Erdfelt aa1c656c31 Updating to version 9.4.17.v20190418 2019-04-18 14:44:28 -05:00
Joakim Erdfelt 5882d63ba7 Updating to version 9.3.28-SNAPSHOT 2019-04-18 13:54:17 -05:00
Joakim Erdfelt d3e249f869 Updating to version 9.3.27.v20190418 2019-04-18 13:10:03 -05:00
Joakim Erdfelt 2c14d93885 Updating to version 9.2.29-SNAPSHOT 2019-04-18 12:17:07 -05:00
Joakim Erdfelt 1dffa36fe3 Updating to version 9.2.28.v20190418 2019-04-18 11:23:17 -05:00
Joakim Erdfelt 3ab1ea3181 Merge branch `jetty-9.2.x` into `jetty-9.3.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
#	jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientURITest.java
#	jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/AbstractHttpClientServerTest.java
#	jetty-fcgi/fcgi-server/src/test/java/org/eclipse/jetty/fcgi/server/HttpClientTest.java
#	jetty-proxy/src/test/java/org/eclipse/jetty/proxy/ConnectHandlerTest.java
#	jetty-server/src/main/java/org/eclipse/jetty/server/handler/DefaultHandler.java
#	jetty-servlet/src/test/java/org/eclipse/jetty/servlet/DefaultServletTest.java
#	jetty-spdy/spdy-http-client-transport/src/test/java/org/eclipse/jetty/spdy/client/http/HttpClientTest.java
#	jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java
#	pom.xml
2019-04-17 16:47:15 -05:00
Joakim Erdfelt 72b4f92280 Updating to tests to protect if IPv6 is unavailable.
+ Updating to jetty-test-helper 4.2.1 with new Net.class
+ Assume.assumeTrue(Net.isIpv6InterfaceAvailable());

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-16 18:10:55 -05:00
Joakim Erdfelt 879e161c22 Updating to tests to protect if IPv6 is unavailable.
+ Updating to jetty-test-helper 3.1.1 with new Net.class
+ Assume.assumeTrue(Net.isIpv6InterfaceAvailable());

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-04-16 16:34:12 -05:00
Joakim Erdfelt 79537a5f51 Updating to version 9.4.17-SNAPSHOT 2019-04-11 11:00:24 -05:00
Joakim Erdfelt e0aa4ae4c0 Updating to version 9.4.16.v20190411 2019-04-11 10:01:26 -05:00
olivier lamy 4ad8553fb1 fix format removing extra space
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-04-07 10:06:06 +10:00
Simone Bordet 40c2e76786 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-04-06 13:45:54 +02:00
Olivier Lamy 8829602201
Exclude ipv6 tests for ci profile (Jenkins) (#3528)
* exclude ipv6 test as currently failing on kubernetes, using junit tag and ci profile activated via Jenkinsfile

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* upgrade surefire to 3.0.0-M3

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-04-06 13:27:42 +10:00
Joakim Erdfelt 9b19374c5d Updating to version 9.2.28-SNAPSHOT 2019-04-03 19:38:05 -05:00
Joakim Erdfelt 84dfe74b97 Updating to version 9.2.27.v20190403 2019-04-03 19:04:45 -05:00
Joakim Erdfelt c70034766e Updating to version 9.3.27-SNAPSHOT 2019-04-03 18:46:31 -05:00
Joakim Erdfelt dae476e369 Updating to version 9.3.26.v20190403 2019-04-03 18:16:32 -05:00
Joakim Erdfelt 2ccde9772b Undoing bad release-9.3.26 2019-04-03 18:11:16 -05:00
Greg Wilkins 9f4b3542cb Updating to version 9.3.27-SNAPSHOT 2019-04-03 17:32:08 +11:00
Greg Wilkins 7ec6d2fb32 Updating to version 9.3.26.v20190403 2019-04-03 13:06:51 +11:00
Simone Bordet 9c13cf3a52 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-04-02 17:37:56 +02:00
Simone Bordet 6fb243ff6c Issue #3464 - Split SslContextFactory into Client and Server
Introduced SslContextFactory subclasses Client and Server.
Replaced all usages of SslContextFactory with either Client or Server
as required.

Refactored configuration checking so that warnings are not emitted
when non necessary.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-03-21 14:42:42 +01:00
Simone Bordet ec8a1bdb23
Merge pull request #3313 from eclipse/jetty-10.0.x-1350-dynamic_client_transport
Issue #1350 - Dynamic selection of the transport to use based on ALPN on the client side.
2019-03-19 15:31:11 +01:00
Joakim Erdfelt 95a6b76851 Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	examples/embedded/src/main/java/org/eclipse/jetty/embedded/OneWebApp.java
#	jetty-osgi/test-jetty-osgi/pom.xml
#	jetty-server/src/main/java/org/eclipse/jetty/server/Server.java
#	jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java
2019-03-15 16:00:59 -05:00
Greg Wilkins 76a37352f5 Issue #3440 Stop on Unavailable
+ revert schedulers to non-daemon threads for now so this PR can
   proceed.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-03-12 09:21:19 +11:00
Greg Wilkins 375ad81f4b Issue #3440 Stop on Unavailable
+ Any schedulers created are named (for ease of debug) and daemon
   so they do not stop the JVM exiting.
 + If the server.doStart() fails, it calls server.doStop to ensure
   connectors are stopped, ports are free etc.
 + cleanup of addBean handling of scheduler in proxy

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-03-07 15:10:53 +11:00
Simone Bordet aa211b033d Issue #1350 - Dynamic selection of the transport to use based on ALPN on the client side.
Introduced `HttpClientTransportDynamic` to be able to switch transport dynamically.
Refactored other transports and HttpDestination, removing now unnecessary classes.

Introduced ProxyProtocolClientConnectionFactory and used it for testing.
Updated OSGi tests now that jetty-client depends on jetty-alpn-client.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-03-06 10:26:10 +01:00
Simone Bordet 39d122a9fb Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-02-28 16:58:23 +01:00
Simone Bordet 057575f1cb Issue #3373 - OutOfMemoryError: Java heap space in GZIPContentDecoder.
Modified jetty-client content decoding to be fully non-blocking;
this allows for a better backpressure and less usage of the buffer
pool.

Modified GZIPContentDecoder to aggregate decoded ByteBuffers in
a smarter way that avoids too many data copies and pollution of
the buffer pool with intermediate size buffers.

Removed duplicate test GZIPContentDecoderTest.

Improved javadocs and improved AsyncMiddleManServlet
to release buffers used by the GZIPContentDecoder.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-02-28 16:11:26 +01:00
Joakim Erdfelt 9cdb59d4d7 Updating to version 9.4.16-SNAPSHOT 2019-02-15 13:35:15 -05:00
Joakim Erdfelt eb70b24016 Updating to version 9.4.15.v20190215 2019-02-15 11:53:00 -05:00
Simone Bordet b9f89af847 Fixes #3320 - Review Jetty 10 module-info.java.
Reviewed module-info.java files.
For those that have a "requires static" added a comment about
why the dependency is optional.
Rearranged directives in alphabetical order.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-02-08 17:30:27 +01:00
Simone Bordet e2506d4811
Merge pull request #3168 from eclipse/jetty-10.0.x-3162_jetty_servlet_api
Issue #3162 - Use Jetty specific Servlet API jar.
2019-02-07 17:33:14 +01:00
Jan Bartel fb90666931 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2019-02-06 17:24:06 +11:00
Simone Bordet 3c9c78c835 Issue #132 - ClientConnector abstraction.
Introduced ClientConnector and refactored HttpClient transports,
removing duplicated code that was connect() to a remote host.

Refactored also HTTP2Client to reference ClientConnector.

Refactored tests accordingly to the changes introduced in the
implementations.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-02-04 18:49:12 +01:00
Simone Bordet 88408375ab Issue #3049 - Warn on common SslContextFactory problematic configurations.
Updating SslContextFactory configuration for tests, since
the change in the default endPointIdentificationAlgorithm
makes the test failing as the certificates are not valid
for the local host, which is different depending on where
the tests are run (locally, jenkins).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-01-31 15:31:35 +01:00
Joakim Erdfelt c30c8d4339 Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-10.0.x-3162_jetty_servlet_api
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-client/pom.xml
#	jetty-http/pom.xml
#	jetty-http2/http2-client/pom.xml
#	jetty-http2/http2-http-client-transport/pom.xml
#	jetty-http2/http2-server/pom.xml
#	jetty-osgi/test-jetty-osgi/pom.xml
#	jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml
#	jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
#	jetty-quickstart/pom.xml
#	jetty-servlets/pom.xml
#	jetty-util/pom.xml
#	jetty-websocket/javax-websocket-client/pom.xml
#	jetty-websocket/javax-websocket-server/pom.xml
#	jetty-websocket/jetty-websocket-server/pom.xml
#	pom.xml
2019-01-30 11:56:58 -06:00
Simone Bordet 6c4ee083be Issue #132 - ClientConnector abstraction.
Introduced ClientConnector and refactored HttpClient transports,
removing duplicated code that was connect() to a remote host.

Refactored also HTTP2Client to reference ClientConnector.

Refactored tests accordingly to the changes introduced in the
implementations.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-01-17 10:43:03 +01:00
Joakim Erdfelt 74df6bf1a9 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-maven-plugin/src/it/it-parent-pom/pom.xml
#	jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/ConfiguratorTest.java
#	jetty-websocket/javax-websocket-server/src/main/java/org/eclipse/jetty/websocket/javax/server/JavaxWebSocketServerContainerInitializer.java
#	jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java
#	jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/AbstractWebSocketConnection.java
#	jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java
#	jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java
#	jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java
#	jetty-websocket/websocket-server/src/test/resources/browser-debug-tool/index.html
#	jetty-websocket/websocket-server/src/test/resources/browser-debug-tool/websocket.js
2019-01-11 12:11:38 -06:00
Greg Wilkins ce3defa2f5 fixed debug
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-01-10 09:07:02 +11:00
olivier lamy 63f2023e05 happy new year!!
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-01-01 12:17:53 +10:00
Olivier Lamy 9b7afd8a03
Happy new year!! (#3232)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-01-01 11:52:16 +10:00
Simone Bordet bfa2dbf68c Issue #3162 - Use Jetty specific Servlet API jar.
* Updated module-info.java to reference the "jetty.servlet.api" module.
* Updated POMs to reference the o.e.j.toolchain:jetty-servlet-api artifact.
* Removed references to jetty-schemas.jar.
* Updated attribute "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern"
  to match the new Jetty Servlet API jar.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-11-29 16:51:29 +01:00
Simone Bordet 5f972b451c
Jetty 10.0.x 2978 add module info (#3120)
Fixes #2978 - Add module-info to relevant Jetty modules.

Added module-info.java for Jetty modules that are not test modules.
Moved jetty-http test utility classes to new module "jetty-http-tools".
Removed generation of test-jar from websocket-core.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-11-22 12:37:35 +01:00
Joakim Erdfelt 29fd18e046 Updating to version 9.4.15-SNAPSHOT 2018-11-14 16:42:40 -06:00
Joakim Erdfelt c4550056e7 Updating to version 9.4.14.v20181114 2018-11-14 15:19:10 -06:00
Joakim Erdfelt a903017f5f Updating to version 9.4.14-SNAPSHOT 2018-11-11 21:06:50 -06:00
Joakim Erdfelt 49123a3313 Updating to version 9.4.13.v20181111 2018-11-11 20:02:42 -06:00
Greg Wilkins be120aa3b5 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2018-10-22 12:20:39 +11:00
Greg Wilkins 15e1c73f9c
Cleanup the dump implementation (#2998)
* Cleanup the dump implementation
* improved the clarity of utility methods for dump and updated most dump methods
* fixed upgrade filter dump
* Improved dump after review
* Moved dumpObjects to Dumpable
* implemented dumpBeans with dumpObjects
* less verbose dump
* Dump streams
* fixed dump test

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-10-22 11:53:59 +11:00
Simone Bordet 8213a95a7b Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2018-10-02 22:51:46 +02:00
Simone Bordet 85d512ceec Restored proper test timeout.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2018-10-02 21:55:09 +02:00
olivier lamy 32912b922d Merge branch 'jetty-9.4.x' into jetty-10.0.x 2018-09-06 17:39:57 +10:00
olivier lamy 1504b7da93 Revert "Issue #2431 - Upgrade to Junit 5 (#2436)"
This reverts commit e24fc48539.
2018-09-06 09:27:11 +10:00
Joakim Erdfelt e24fc48539 Issue #2431 - Upgrade to Junit 5 (#2436)
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug https://github.com/junit-team/junit5/issues/801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@Before      | @BeforeEach
@After       | @AfterEach
@BeforeClass | @BeforeAll
@AfterClass  | @AfterAll

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2018-09-05 21:27:18 +10:00
Joakim Erdfelt a3f1592c50 Issue #2431 - Upgrade to Junit 5 (#2436)
+ Changes needed for new Junit 5
+ Migrating from Vintage junit API to Jupiter junit API
+ Relies on SNAPSHOT jetty-test-helper
  - this will be a formal release once this issue has been
    resolved satisfactory
+ Have jenkins always pull latest SNAPSHOT for each build
+ Adding jetty.snapshots repository
+ Using surefire 2.22.0 per advice from junit
+ Ensuring <reuseForks>true</reuseForks> to work around issue junit-team/junit5#801
+ Disabling <forkMode>always</forkMode> in maven-surefire-plugin
  due to bug https://github.com/junit-team/junit5/issues/801
+ OSGi tests must remain at vintage due to PaxExam
+ Moving from vintage TestingDir to jupiter WorkDir
+ Fixing imports to use jupiter, not vintage
+ Migrating vintage ExpectedException to jupiter assertThrows
+ Migrating vintage TestName to jupiter TestInfo
+ Migrating @RunWith(Parameterized.class)
  to @ParameterizedTest with Argument Sources
+ Migrating assertTrue(val.contains(needle))
  to assertThat(val, containsString(needle))
+ Aligning junit versions per recommendations from @sormuras
+ Adjusting parameter order change for assertEquals()
+ Test LifeCycle Annotation Migration

junit 4      | junit 5 / jupiter
------------ | -----------
@Before      | @BeforeEach
@After       | @AfterEach
@BeforeClass | @BeforeAll
@AfterClass  | @AfterAll

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2018-09-05 10:07:17 +10:00
Jesse McConnell 863a19bccf
Updating to version 9.3.26-SNAPSHOT 2018-09-04 17:23:31 -05:00
Jesse McConnell 3ce520221d
Updating to version 9.3.25.v20180904 2018-09-04 16:08:21 -05:00
Jesse McConnell dcf6a8fa9f
Updating to version 9.4.13-SNAPSHOT 2018-08-30 10:48:22 -05:00
Jesse McConnell 2720868475
Updating to version 9.4.12.v20180830 2018-08-30 08:56:44 -05:00
Joakim Erdfelt 516d93c488 Updating to version 9.2.27-SNAPSHOT 2018-08-06 11:33:22 -05:00
Joakim Erdfelt 8c637489ae Updating to version 9.2.26.v20180806 2018-08-06 10:51:25 -05:00
Joakim Erdfelt 0b69f00665 Updating to version 9.4.12-SNAPSHOT 2018-07-11 17:32:16 -05:00
Joakim Erdfelt 260596dd10 Updating to version 9.4.12.RC0 2018-07-11 16:30:55 -05:00
Joakim Erdfelt 30f6132117 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2018-07-03 10:55:22 -05:00
Greg Wilkins 346879f2a5
Merge pull request #2664 from mperktold/jetty-9.4.x
Issue #2662 Unnecessary boxing conversions
2018-06-13 22:52:27 +02:00
Matthias Perktold f901efc413 Issue #2662 - Unnecessary boxing conversions
Signed-off-by: Matthias Perktold <tias251@gmail.com>
2018-06-13 16:20:12 +02:00
Joakim Erdfelt 0cd4dacbac Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	VERSION.txt
#	aggregates/jetty-all-compact3/pom.xml
#	aggregates/jetty-all/pom.xml
#	apache-jsp/pom.xml
#	apache-jstl/pom.xml
#	examples/async-rest/async-rest-jar/pom.xml
#	examples/async-rest/async-rest-webapp/pom.xml
#	examples/async-rest/pom.xml
#	examples/embedded/pom.xml
#	examples/pom.xml
#	jetty-alpn/jetty-alpn-client/pom.xml
#	jetty-alpn/jetty-alpn-conscrypt-client/pom.xml
#	jetty-alpn/jetty-alpn-conscrypt-server/pom.xml
#	jetty-alpn/jetty-alpn-java-client/pom.xml
#	jetty-alpn/jetty-alpn-java-server/pom.xml
#	jetty-alpn/jetty-alpn-openjdk8-client/pom.xml
#	jetty-alpn/jetty-alpn-openjdk8-server/pom.xml
#	jetty-alpn/jetty-alpn-server/pom.xml
#	jetty-alpn/pom.xml
#	jetty-annotations/pom.xml
#	jetty-ant/pom.xml
#	jetty-bom/pom.xml
#	jetty-cdi/cdi-2/pom.xml
#	jetty-cdi/cdi-core/pom.xml
#	jetty-cdi/cdi-full-servlet/pom.xml
#	jetty-cdi/cdi-servlet/pom.xml
#	jetty-cdi/cdi-websocket/pom.xml
#	jetty-cdi/pom.xml
#	jetty-cdi/test-cdi-webapp/pom.xml
#	jetty-client/pom.xml
#	jetty-continuation/pom.xml
#	jetty-deploy/pom.xml
#	jetty-distribution/pom.xml
#	jetty-documentation/pom.xml
#	jetty-fcgi/fcgi-client/pom.xml
#	jetty-fcgi/fcgi-server/pom.xml
#	jetty-fcgi/pom.xml
#	jetty-gcloud/jetty-gcloud-session-manager/pom.xml
#	jetty-gcloud/pom.xml
#	jetty-hazelcast/pom.xml
#	jetty-home/pom.xml
#	jetty-http-spi/pom.xml
#	jetty-http/pom.xml
#	jetty-http2/http2-alpn-tests/pom.xml
#	jetty-http2/http2-client/pom.xml
#	jetty-http2/http2-common/pom.xml
#	jetty-http2/http2-hpack/pom.xml
#	jetty-http2/http2-http-client-transport/pom.xml
#	jetty-http2/http2-server/pom.xml
#	jetty-http2/pom.xml
#	jetty-infinispan/pom.xml
#	jetty-io/pom.xml
#	jetty-jaas/pom.xml
#	jetty-jaspi/pom.xml
#	jetty-jmx/pom.xml
#	jetty-jndi/pom.xml
#	jetty-jspc-maven-plugin/pom.xml
#	jetty-maven-plugin/pom.xml
#	jetty-memcached/jetty-memcached-sessions/pom.xml
#	jetty-memcached/pom.xml
#	jetty-nosql/pom.xml
#	jetty-osgi/jetty-osgi-alpn/pom.xml
#	jetty-osgi/jetty-osgi-boot-jsp/pom.xml
#	jetty-osgi/jetty-osgi-boot-warurl/pom.xml
#	jetty-osgi/jetty-osgi-boot/pom.xml
#	jetty-osgi/jetty-osgi-httpservice/pom.xml
#	jetty-osgi/pom.xml
#	jetty-osgi/test-jetty-osgi-context/pom.xml
#	jetty-osgi/test-jetty-osgi-fragment/pom.xml
#	jetty-osgi/test-jetty-osgi-server/pom.xml
#	jetty-osgi/test-jetty-osgi-webapp/pom.xml
#	jetty-osgi/test-jetty-osgi/pom.xml
#	jetty-plus/pom.xml
#	jetty-proxy/pom.xml
#	jetty-quickstart/pom.xml
#	jetty-rewrite/pom.xml
#	jetty-runner/pom.xml
#	jetty-security/pom.xml
#	jetty-server/pom.xml
#	jetty-server/src/main/config/etc/jetty-http.xml
#	jetty-server/src/main/config/etc/jetty-ssl.xml
#	jetty-servlet/pom.xml
#	jetty-servlets/pom.xml
#	jetty-spring/pom.xml
#	jetty-start/pom.xml
#	jetty-unixsocket/pom.xml
#	jetty-util-ajax/pom.xml
#	jetty-util/pom.xml
#	jetty-util/src/main/java/org/eclipse/jetty/util/MultiException.java
#	jetty-util/src/test/java/org/eclipse/jetty/util/MultiExceptionTest.java
#	jetty-webapp/pom.xml
#	jetty-websocket/javax-websocket-client-impl/pom.xml
#	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/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/TrackingSocket.java
#	jetty-websocket/pom.xml
#	jetty-websocket/websocket-api/pom.xml
#	jetty-websocket/websocket-client/pom.xml
#	jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientCloseTest.java
#	jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/ClientConnectTest.java
#	jetty-websocket/websocket-common/pom.xml
#	jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/extensions/compress/ByteAccumulator.java
#	jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/extensions/compress/CompressExtension.java
#	jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/WebSocketRemoteEndpointTest.java
#	jetty-websocket/websocket-server/pom.xml
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketUpgradeFilterTest.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/misbehaving/MisbehavingClassTest.java
#	jetty-websocket/websocket-servlet/pom.xml
#	jetty-websocket/websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/extensions/FragmentExtensionTest.java
#	jetty-websocket/websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/jsr356/sockets/pong/PongContextListener.java
#	jetty-websocket/websocket-tests/src/test/java/org/eclipse/jetty/websocket/tests/server/jsr356/ConfiguratorTest.java
#	jetty-xml/pom.xml
#	pom.xml
#	tests/pom.xml
#	tests/test-continuation/pom.xml
#	tests/test-http-client-transport/pom.xml
#	tests/test-integration/pom.xml
#	tests/test-jmx/jmx-webapp-it/pom.xml
#	tests/test-jmx/jmx-webapp/pom.xml
#	tests/test-jmx/pom.xml
#	tests/test-loginservice/pom.xml
#	tests/test-quickstart/pom.xml
#	tests/test-sessions/pom.xml
#	tests/test-sessions/test-file-sessions/pom.xml
#	tests/test-sessions/test-gcloud-sessions/pom.xml
#	tests/test-sessions/test-hazelcast-sessions/pom.xml
#	tests/test-sessions/test-infinispan-sessions/pom.xml
#	tests/test-sessions/test-jdbc-sessions/pom.xml
#	tests/test-sessions/test-memcached-sessions/pom.xml
#	tests/test-sessions/test-mongodb-sessions/pom.xml
#	tests/test-sessions/test-sessions-common/pom.xml
#	tests/test-webapps/pom.xml
#	tests/test-webapps/test-http2-webapp/pom.xml
#	tests/test-webapps/test-jaas-webapp/pom.xml
#	tests/test-webapps/test-jetty-webapp/pom.xml
#	tests/test-webapps/test-jndi-webapp/pom.xml
#	tests/test-webapps/test-mock-resources/pom.xml
#	tests/test-webapps/test-proxy-webapp/pom.xml
#	tests/test-webapps/test-servlet-spec/pom.xml
#	tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
#	tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
#	tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
#	tests/test-webapps/test-webapp-rfc2616/pom.xml
2018-06-12 11:11:38 -05:00
Joakim Erdfelt 0e6c91b604 Updating to version 9.2.26-SNAPSHOT 2018-06-06 18:54:58 -05:00
Joakim Erdfelt 4830fd15e9 Updating to version 9.2.25.v20180606 2018-06-06 16:42:54 -05:00