Commit Graph

1903 Commits

Author SHA1 Message Date
Simone Bordet 1cb09db75a Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-09-30 09:01:57 +02:00
Simone Bordet a85a18e0d8 Fixes #3787 - Jetty client throws EOFException instead of SSLHandshakeException on certificate errors.
Fixed indent.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-30 08:53:12 +02:00
Simone Bordet ad2770ddc2 Fixes #3787 - Jetty client throws EOFException instead of SSLHandshakeException on certificate errors.
Updates after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-27 00:15:34 +02:00
Simone Bordet 2c75e876a3 Fixes #3787 - Jetty client throws EOFException instead of SSLHandshakeException on certificate errors.
Now exceptions thrown by fill() or flush() are stored in a field.
Further fill() operations will rethrow the original exception rather
than returning -1.

Returning -1 to application was causing them to close() with a generic
failure that was triggering the EOFException reported in this issue.

Now applications see the original exception and can close() with the
proper cause.

Re-enabled HostnameVerificationTest that was reproducing this issue
reliably but was @Disabled a while back and never re-enabled.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-26 18:30:43 +02:00
Simone Bordet d12df30df7 Issue #3787 - Jetty client throws EOFException instead of SSLHandshakeException on certificate errors.
Code cleanups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-26 18:18:13 +02:00
Joakim Erdfelt cf993e579e Merge branch 'jetty-9.4.x' into jetty-10.0.x 2019-09-23 12:07:43 -05:00
Simone Bordet b3be28086b Fixes #4113 - HttpClient fails with JDK 13 and TLS 1.3.
1. Now forwarding the fillable event rather than assuming that is due
to garbage bytes or by a server close. This ensures that a HTTP read
consumes the TLS bytes and the `NewSessionTicket` message.
2. Avoid to set the `SslConnection` onto the `EndPoint` in
`SslClientConnectionFactory` - this allows upgrades to work properly,
for example when tunnelling through a secure proxy.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-23 17:59:37 +02:00
Simone Bordet 1ef4a416b5 Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-3952-server_direct_heap_bytebuffers'. 2019-09-16 12:26:26 +02:00
Simone Bordet f942cd4687 Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-4058-autolock'. 2019-09-11 22:41:11 +02:00
Joakim Erdfelt 6e740060f7 Merge branch 'jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java
2019-09-10 08:22:00 -05:00
Joakim Erdfelt 68382b9549 Issue #3989 - Cleaning up ManagedSelector.onSelectFailed
+ Based on PR review

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-10 03:46:26 -05:00
Simone Bordet 692c017500 Fixes #4058 - Review Locker.
Removes the Locker class, replaced by AutoLock.
Removed usages of Locker.isLocked() from the session code
since it was not necessary.
Took the chance to do a little code cleanup.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-09-09 16:18:46 +02:00
Joakim Erdfelt b7b744160f Issue #3989 - Tests for both Restart Server and Selector
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-06 16:10:30 -05:00
Joakim Erdfelt f8041b23bd Issue #3989 - Cleaning up ManagedSelector.doStop() for dead selector
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-06 14:54:01 -05:00
Joakim Erdfelt 0fd989f0cd Issue #3989 - Restoring _selector to null on failure
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-06 08:24:51 -05:00
Joakim Erdfelt d8efb62d13 Issue #3989 - Select Failure does not attempt to restart selector
+ Changes from PR review

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-05 12:12:49 -05:00
Joakim Erdfelt 9305914d6a Issue #3989 - Selector failure notification
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-09-04 11:16:24 -05:00
Joakim Erdfelt f6efff70d7 Issue #3989 - Selector failure notification
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-08-30 13:47:16 -05:00
Greg Wilkins af8587c108 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-27 08:15:41 +10:00
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
Simone Bordet 985d98296b Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-3952-server_direct_heap_bytebuffers'. 2019-08-14 15:45:49 +02: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
Simone Bordet 5ccaea3c74 Fixes #3952 - Server configuration for direct/heap ByteBuffers.
Updated server-side to use direct/heap ByteBuffers based on
getters and setters in the relevant components.
Made HTTP/1.1, HTTP/2, and WebSocket use the same mechanism.

Removed unused obsoleted methods:
* EndPoint.isOptimizedForDirectBuffers()
* HttpTransport.isOptimizedForDirectBuffers()
* HttpOutput.Interceptor.isOptimizedForDirectBuffers()
* HttpChannel.useDirectBuffers()

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-12 17:20:50 +02:00
Simone Bordet c310eb0fb9 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-08-07 13:52:16 +02:00
Simone Bordet 264ceb143d Fixes #3601 - HTTP2 stall on reset streams.
After review, introduced WriteFlusher.isPending() and now using that
in the test case to test for TCP congestion.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-07 11:48:31 +02:00
Simone Bordet 6753b43d41 Avoiding NPEs when using ClientConnector directly.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-31 15:30:18 +02:00
Simone Bordet 873d1c6d7d Fixes #3601 - HTTP2 stall on reset streams.
The client reset wakes up threads blocked in
writes, but these may again attempt to write,
therefore blocking again.

Now we detect that the stream is not writable
and mark the transport as failed, so that
writes fail immediately without blocking.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-25 22:21:13 +02: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
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
Simone Bordet 790051556f Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2019-06-13 10:03:54 +02:00
Lachlan c94753ece3
Issue #3746 - fix WriteFlusher ClassCastException if Callback throws (#3778)
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-13 15:51:22 +10: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 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
Joakim Erdfelt c33f3a75ed Merge branch `release-9.4.18` into `jetty-9.4.x` 2019-04-30 11:44:06 -05:00
Greg Wilkins d84a4efde5 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-04-30 13:46:59 +02:00
Simone Bordet de9cc312a4 Fixes #3534 - Don't use System.currentTimeMillis() in IdleTimeout.
Removed usages of System.currentTimeMillis() and cleaned up the code.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-04-30 15:24:24 +04: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