Commit Graph

1209 Commits

Author SHA1 Message Date
Ludovic Orban a10b98e95b add JDK bug ID
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-29 09:59:03 +02:00
Lachlan Roberts 48bfc70b2d use enum for DemandState in WebSocketConnection
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-29 08:04:18 +10:00
Lachlan 0941969863
Merge pull request #9945 from eclipse/jetty-12.0.x-WebSocketDemand
Issue #9944 - remove integer from demand in websocket core
2023-06-29 07:53:03 +10:00
Joakim Erdfelt 0863b555dd
Fix Path to URL conversion for windows users (#9989)
* Fix Path to URL conversion for windows users
2023-06-28 14:04:21 -05:00
Ludovic Orban cc3bac27a5
#9984 fix URLResourceFactory isDirectory and newReadableByteChannel (#9985)
* #9984 fix URLResourceFactory isDirectory and newReadableByteChannel

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-28 18:36:00 +02:00
Greg Wilkins daa7167834
Implement quality lists for Locales (#9983)
Implement quality lists for Locales that orders known locales before unknown.
2023-06-28 14:22:13 +02:00
Greg Wilkins 617821445a
Fix #9960 Improve Request methods, including NPE protection. (#9971)
Fix #9960 with NPE protection for bad requests.
2023-06-28 12:07:11 +02:00
Lachlan Roberts c942a918d9 fixes for websocket demand changes
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-28 14:30:17 +10:00
Joakim Erdfelt 54dbd9515a
Adding test to prove out zipfs bug with backslash character 2023-06-27 07:25:22 -05:00
Lachlan Roberts 0709946675 Issue #9965 - make multiple websocket demand throw ISE
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-27 14:09:41 +10:00
Lachlan Roberts 2b4e8960e6 #9945 - update javadoc to say demand() can throw ReadPendingException
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-27 13:51:22 +10:00
Ludovic Orban cbd83c91c2
Fix default servlet character encoding directories (#9970)
#9966 adapt character encoding when including a path that is a directory listing

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-26 22:09:17 +02:00
Steffen Nießing 939689b669
Spotbugs fixes (#9961)
* Add zone id to DateTimeFormatter

Inline the call to withZone(ZoneId) because it returns a new DateTimeFormatter instead of modifying the current one in-place

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Remove redundant null-check

The array already was null-checked, so remove the redundant check

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Cleanup ArrayUtil

ArrayUtil provides static methods only -> Prevent instantiation and remove unused interfaces

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Remove dead assignment

The charset variable isn't accessed after the assignment anymore

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Prevent instantiation

TypeUtil contains static members only and should not be instantiated

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Remove redundant null-check

The loader variable is checked to be non-null before

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Restrict charset to ascii

The JavaDoc describes the byte array to contain ascii characters only

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Prevent instantiation

StringUtil contains static members only

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* Prevent instantiation

IO contains static members only

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

---------

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
2023-06-26 18:24:13 +02:00
Greg Wilkins 3a5136834f
Deflake ReservedThreadExecutorTest (#9968)
* Deflake ReservedThreadExecutorTest

Use awaitability with longer times to avoid short optimistic waits in tests.

* Deflake ReservedThreadExecutorTest

Use awaitability with longer times to avoid short optimistic waits in tests.
2023-06-26 16:16:35 +02:00
Lachlan Roberts 2030afea62 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-WebSocketDemand 2023-06-26 12:12:56 +10:00
Simone Bordet ef1fa40790
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-25 10:39:48 +02:00
Greg Wilkins 62e6cf2b76
Fix #9953 handled HEAD (#9957)
* Fix #9953 handled HEAD

Fix #9953 so that if a Handler self handles HEAD by not writing content, then the length checks do not fire if 0 bytes have been written.

* updates from review
2023-06-23 17:21:27 +02:00
Ludovic Orban 8f4a15c7da
#9946 Stop passing Handler in constructor as a parent (#9948)
#9946 Stop passing Handler in constructor as a parent

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-23 14:44:12 +02:00
gregw 875740fde7 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-ee9/jetty-ee9-proxy/src/test/java/org/eclipse/jetty/ee9/proxy/AbstractProxyServletTest.java
2023-06-23 09:24:43 +02:00
Greg Wilkins a3e82326cf
Experiment/jetty 12 chunk isError and warnings (#9904)
* Remove usage of instanceof Content.Chunk.Error
* Updated AsyncContent to accept a transient failures
* Updated AsyncContent to accept a transient failure with inputstream
2023-06-23 09:17:15 +02:00
Greg Wilkins 9a38e3ba41
Reinstated StopTest (#9950)
Reenbled StopTest for #9949
2023-06-23 07:09:58 +02:00
Greg Wilkins 0b1c28a888
Jetty 12 inserted handler in ee10 servlet context (#9927)
This PR refactors the ee10 handing of servlet API request and response objects:

 + The ServletContextHandler matches the request to a servlet and creates a one time only ServletContextRequest and a ServletContextResponse
 + A reusable ServletChannel object with all the heavy weight HttpInput and HttpOutput object is associated with the ServletContextRequest and ServletContextResponse.
 + Once the handling reaches the ServletHandler, the possibly wrapped request, response and callback are associated with the ServletChannel before handling.
 + Were possible the ServletApiRequest and ServletApiResponse use the possibly wrapped request/response

Added tests to check that GzipHandler can now be nested inside of an EE10 context.

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: gregw <gregw@webtide.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-22 17:04:49 +02:00
Jan Bartel 715535ab95 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-22 11:50:06 +02:00
Lachlan Roberts 9e99a58ac4 Issue #9944 - remove integer from demand in websocket core
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-22 09:08:29 +10:00
Ludovic Orban b9ca6d2233
Fix ee10 path info only (alternative) (#9934)
Fix ee10 path info only

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Jan Bartel <janb@webtide.com>
2023-06-21 17:50:33 +02:00
gregw 5116039660 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-21 11:19:50 +02:00
Lachlan b5360f377f
Merge pull request #9923 from eclipse/jetty-12.0.x-9919-ServerByteBufferPool
Issue #9919 - Avoid creating two ByteBufferPools for the server
2023-06-21 11:53:14 +10:00
Ludovic Orban 5d97175686
Remove ee10 HttpChannel.Listener (#9920)
* remove ee10 HttpChannel.Listener

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-20 17:27:15 +02:00
Steffen Nießing 5d87ea7254
Fix spotbugs packages (#9929)
* Fix spotbugs packages

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>

* remove jdk17 profile which disable spotbugs

---------

Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2023-06-20 10:54:16 +10:00
Lachlan Roberts a2832b8ec1 Issue #9919 - Avoid creating two ByteBufferPools for the server
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-19 17:19:10 +10:00
Lachlan Roberts b9d6c1c0b5 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-9396-websocket-jpms-review 2023-06-19 13:24:05 +10:00
Lachlan 2a683e7774
Merge pull request #9916 from eclipse/jetty-12.0.x-PR9903-Merge
Merge PR #9903 to Jetty-12 (PerMessageDeflateExtension callback completion)
2023-06-16 14:23:22 +10:00
Greg Wilkins 926a15aa62
fixing JPMS and reactivating the tests (#9911)
* WIP fixing JPMS and reactivating the tests

* fix jndi demos with jpms activated

Signed-off-by: Olivier Lamy <olamy@apache.org>

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2023-06-16 12:52:11 +10:00
Lachlan Roberts 5d4fa756a0 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-16 08:11:28 +10:00
Lachlan Roberts c70b940751 prevent potential NPE from StartArgs
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-16 07:46:32 +10:00
Lachlan 58cee22ba4
Merge pull request #9908 from eclipse/jetty-12.0.x-PR9891
Merge PR #9891 to Jetty-12
2023-06-16 07:24:38 +10:00
Ludovic Orban 8e79c1b58b
Add `EventsHandler` API (#9901)
* #8885 add EventsHandler API

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-15 17:31:11 +02:00
Lachlan Roberts 48367f3baf Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-15 13:56:28 +10:00
Jan Bartel 4e316dbf62
Jetty 12.0.x ee9 serverpush tck (#9902)
* Make a test case to resemble a failing tck test

* Add more test cases more like the tck test

* Fixed processing of EOF frames for pushed requests.

Before, the EOF frame was not added to the HTTP2Stream queue.
When the pushed request was completing it tried to consume the available content, but it was not finding EOF and so was emitting a reset frame, causing the TCK failure.

Now the EOF frame is always added to the HTTP2Stream queue, so it is properly consumed when completing the pushed request.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* Fix H2 trailers frames

Signed-off-by: Ludovic Orban <lorban@bitronix.be>

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-14 14:22:45 +02:00
Lachlan Roberts b0923b2fd9 Issue #9396 - fixes to resolve WebSocket JPMS warnings
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-14 18:01:21 +10:00
Greg Wilkins 963d33111e
Jetty 12 idletimeout (#9905)
* IdleTimeout review

 + pass TimeoutException through all APIs
 + HttpConnection now passes on TimeoutException to HttpChannel.onFailure
* More ServerTests for idletimeout

* Recreated a ServerTimeoutsTest for multiple transports

* more robust tests

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* merged work from @sbordet and @gregw

* Various improvements to CyclicTimeouts.
* Improved reset of the earliest timeout before iteration.
* Removed check for getExpireNanoTime() == -1, since it's a valid value.
* When onExpired(Expirable) returns false, the Expirable should arrange to move its timeout in the future.

* fix keystore to please BoringSSL + use correct temp path

Signed-off-by: Ludovic Orban <lorban@bitronix.be>

* Fixed ErrorResponseAndCallback succeeded() and failed() to call super.failed() in all cases to complete the wrapped callback.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* Revert "Fixed ErrorResponseAndCallback succeeded() and failed() to call super.failed() in all cases to complete the wrapped callback."

This reverts commit 5ac57c13e0.

* WIP idleTimeout

* WIP idleTimeout

* Added context wrapper for idle timeout listener

* updates from review

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-14 09:57:10 +02:00
Greg Wilkins d3e88a95fe
Jetty 12.0.x custom request log #8819 (#9896)
* Resolve #8819 CustomRequestLog improvement

Resolves #8819 CustomRequestLog improvements:
 + only add extra detail if the log is a CustomRequestLog
 + add extra detail as a record
 + get authentication state directly from request attribute

* protect against null core request

* protect against null core request

* Use nanotime for logged latency
2023-06-13 11:12:45 +02:00
Simone Bordet 601bd687aa
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-11 19:12:59 +02:00
Simone Bordet 0a9bbde6d0
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-11 19:09:02 +02:00
Simone Bordet df24485000
Various improvements to CyclicTimeouts. (#9897)
* Improved reset of the earliest timeout before iteration.
* Removed check for getExpireNanoTime() == -1, since it's a valid value.
* When onExpired(Expirable) returns false, the Expirable should arrange to move its timeout in the future.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-10 17:02:37 +02:00
Ludovic Orban d5200c6c63 #9881 add thread-safety documentation
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-08 23:55:30 +02:00
Ludovic Orban 9547104163 #9881 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-08 23:55:30 +02:00
Ludovic Orban b97090a6b4 #9881 manually maintain the size to avoid calling ConcurrentLinkedQueue.size()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-08 23:55:30 +02:00
Olivier Lamy a617784e8e
Remove duplicated classes from test session, fix some to be able to run in parallel and not restarting 3rd party for each tests (#9782)
---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-06-09 06:47:36 +10:00
Greg Wilkins c2dc87c039
Jetty 12 #9630 dumpable context (#9885)
* Fix #9630 dumpable context

Added DumpableAttributes utility class

* fixed test format

* Updates from review
2023-06-08 21:14:04 +02:00
Jan Bartel 4ec7dc73f6
Jetty 12.0.x 9072 move core ee classes (#9883)
* Issue #9072 refactor jetty-ee module to remove it

* Remove old ee imports in module-info.javas

* Remove jetty-ee from deps

* Fix references to jetty-ee for osgi

* Update jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/Deployable.java

Co-authored-by: Greg Wilkins <gregw@webtide.com>

---------

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-06-08 18:22:57 +02:00
Greg Wilkins c0de62b2c6
Jetty 12 graceful contexts (#9867)
Removed all shutdown mechanisms from ContextHandler
Fixed GracefulHandler

---------

Signed-off-by: gregw <gregw@webtide.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-07 21:05:49 +02:00
Greg Wilkins a44a99ad9b
SetCookieHttpField #9173 (#9789)
Added utility methods and classes to allow for efficient interception of a Set-Cookie header in a HttpStream wrapper.
2023-06-07 13:50:19 +02:00
Simone Bordet 714d2a4ac9
Fixed Environment.Named.toString().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-07 00:11:21 +02:00
Simone Bordet 4e6575b994
Fixes #8033 - Jetty-12 already completed exception in http2.tests.MaxConcurrentStreamsTest.
Fixed by the work done in #9684.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-06 20:31:35 +02:00
Ludovic Orban 4456f99de7 H3: release the buffer when the stream is closing
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-06 18:25:14 +02:00
Ludovic Orban 15d67bdf57 H3: disable using an IP(v4 or v6) address as the hostname as BoringSSL requires a SAN dns attribute for the IP addresses that keytool refuses to create
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-06 18:25:14 +02:00
Ludovic Orban ea7369b769 H3: fix interim responses
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-06 18:25:14 +02:00
gregw dfca108603 Update test 2023-06-06 09:33:27 +02:00
Ludovic Orban c1f1a6018b Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-05 17:31:13 +02:00
Greg Wilkins 1c01a49149
Jetty 12 context initial ClassLoader (#9866)
* Ensure environment classloader in ContextHandler
* Set the initial classloader in ContextHandler
* WebAppContext uses initial classloader
2023-06-05 16:49:15 +02:00
Ludovic Orban 0abba456ac Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-01 10:30:35 +02:00
Ludovic Orban 64b4d60246 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-05-31 11:49:24 +02:00
Ludovic Orban cfc5c58bdb fix merge that missed setting the truststore and updating a test keystore
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-05-29 10:55:47 +02:00
Lachlan Roberts 9acd5e83dc Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-05-29 16:47:59 +10:00
Simone Bordet 8c4e75bf8d
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-28 00:34:49 +02:00
Simone Bordet 476145b817
Fixed FCGI content parsing. (#9790)
* Fixed FCGI content parsing.

WordPress sends the initial content in the same frame as the response headers.
StreamContentParser was receiving the frame, delegating to HttpParser to parse the headers,
but the buffer was still containing some content, that was lost.
Now the content after the headers is correctly retained.

For the direct FastCGI APIs, now a read-only version of the buffer is passed to the listener,
and the original buffer is consumed as the caller expects.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-25 15:22:30 +02:00
Simone Bordet e0ff8cd1a5
Simplified and fixed TryPathsHandler. (#9792)
Improved logging and variable naming in related classes.

Previously, a 404 received from a child handler would have resulted in an infinite loop trying to write the 404 response. However, `TryPathsHandler` should just delegate to other handlers.

Replaced the `IteratingCallback` loop with a simple `for` loop over the paths to try, returning if the path was handled by a child `Handler`.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-23 21:26:35 +02:00
Ludovic Orban ece6adbd33 #9765 fix race condition that can happen when one thread demands and another thread reads
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-05-23 19:17:39 +02:00
Lachlan Roberts 152030de09 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-05-22 18:05:21 +10:00
Greg Wilkins 18c4846b1c
Jetty 12 simplify EchoHandler (#9783) 2023-05-18 09:50:09 +02:00
Greg Wilkins 068a60a868
Simplified QuotedStringTokenizer (#9729)
Simplified QuotedStringTokenizer #9729
* Now implements a simple subset of `quoted-string` from RFC9110
* introduced builder
* Extracted QuotedStringTokenizer interface and re-introduced the legacy implementation
* Re-introduced the ability to have unescaped \ in filenames
* Whitespace is Character.isWhiteSpace
* Disable test pending RFC8187
* No OWS around =
2023-05-18 08:25:53 +02:00
Simone Bordet eaeb633fbe
Fixed flaky test ClientServerTest.testReadDataFromOnRequestWithoutDemanding().
Removed assumption that returning a null stream listener implies that the stream input must be shut down,
because the reads may be performed in a spin loop in another thread, without demanding.

Rewritten the test to avoid blocking the thread that called onRequest(), otherwise the data frames cannot
be read from the network.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-17 22:57:23 +02:00
Simone Bordet e52e95f788
Fixes #9766 - jetty-12 ee9 ServerPush failures. (#9776)
* Restored dispatch=true for pushed requests.
* Restored tests that use the Servlet APIs to push.
* Ensured that pushed streams have request content EOF.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-17 15:42:05 +02:00
Simone Bordet 7bbf966949
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-15 16:48:06 +02:00
Simone Bordet b884469103
FCGI improvements. (#9733)
* FCGI improvements.

* Better handling for HTTPS parameter on server side.
* Better handling of unknown frame types.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-15 15:04:50 +02:00
Ludovic Orban ac2765c98d Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-05-15 10:09:36 +02:00
Joakim Erdfelt 2fdcae40f0
Refine how Request / Channel / Stream completion works (#9684)
Fixes #9684
+ Restore LargeHeaderTest Test
+ Fix Bad Content-Length produced if write + error occurs
+ Fix race between callback failure and error handling failure
+ Introduce new ResponseCompleteTest to attempt to capture complete race issue
+ More DEBUG + ignoring failure for completeStream
+ Removed ErrorResponse in favour or an errorMode

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-15 08:15:37 +02:00
Greg Wilkins 4b67abcf38
Jetty 12 immutable ee10 configurations (#9724)
* Immutable EE10 Configurations
2023-05-13 08:17:42 +02:00
Ludovic Orban ef0f7a06e1 #9680 prevent AttributeNormalizer from accepting combined resources
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-05-12 18:34:41 +02:00
Jan Bartel 2261ce9a50
Issue #9762 ee9 double parses cookies (#9764)
* Issue #9762 ee9 double parses cookies

* implemented the TODOs to cache servlet cookies

---------

Co-authored-by: gregw <gregw@webtide.com>
2023-05-12 17:14:44 +02:00
Lachlan Roberts b16660388f fix ParserTest after merge
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-11 11:14:16 +10:00
Lachlan Roberts 07c8c8a2cf Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-05-11 11:08:31 +10:00
Jan Bartel ba676021b6
Issue #9750 Fix value of login-config/auth-method for CLIENT-CERT (#9751) 2023-05-10 01:06:35 +10:00
Lachlan Roberts 2f76ba2298 fix to QPACK instruction generation
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-09 12:09:42 +10:00
Lachlan Roberts 422cddf8b1 merge hpack/qpack changes to 12 from #9634
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-08 16:44:28 +10:00
Greg Wilkins 4c16e6a707
Jetty 12 content length 0 take3 (#9740)
* Optimize Content-Length: 0 handling

Create and use a pre-encoded HttpFields.CONTENT_LENGTH_0 constant
Used the constant in more places
renamed the `putLongField` methods of HttpFields.Mutable to just `put`
Fixed wrong docs examples
2023-05-07 19:22:15 +02:00
Jan Bartel 11a67fbdd7
Issue #9731 infinite loop in role refs (#9732)
* Issue #9731 infinite loop in role refs

* Update jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/UserIdentityScope.java

Co-authored-by: Greg Wilkins <gregw@webtide.com>

---------

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-05-06 00:58:22 +10:00
Simone Bordet 7e6de2512c
Fixed range-request tests after merge.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-05 11:06:06 +02:00
Simone Bordet baf72248aa
Fixed tests after merge.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-04 22:36:00 +02:00
Simone Bordet 3463e42861
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-04 12:08:00 +02:00
Olivier Lamy 0896927e13 fix boms
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-05-03 20:28:47 +10:00
Olivier Lamy 99a2853547 add missing entry jetty-security in core bom
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-05-03 20:11:56 +10:00
Simone Bordet adf5754836
Fixes #9552 - Jetty 12 - Rewrite of the Jetty WebSocket APIs. (#9652)
* Removed unnecessary classes, among which `BatchMode`, `CloseStatus`, etc.
* Coalesced all listener interfaces into `Session.Listener`.
* Moved `RemoteEndpoint` functionality to `Session`.
* Renamed `WebSocketPolicy` to `Configurable`.
* Renamed `WriteCallback` to just `Callback`, as it is now also used for some listener methods.
* Renamed `@OnWebSocketConnect` to `@OnWebSocketOpen`
* Renamed `Session.Listener.onWebSocketConnect()` to `onWebSocketOpen()`.
* Removed `@WebSocket` annotation attributes, because they were just a subset of the configurable ones and they can be configured directly on the Session instance.
* Removed `Session.suspend()` and `SuspendToken`, and introduced `Session.demand()`.
* Introduced `@WebSocket.autoDemand` and `Session.Listener.AutoDemanding` to support automatic demand upon exit of WebSocket handler methods.
* Removed `FrameHandler.isAutoDemanding()` and `CoreSession.isAutoDemanding()`.
* Changed the responsibility of demand from `WebSocketCoreSession` to `FrameHandler`, which in turn may delegate to `MessageSink`.
* Updated MessageInputStream to fail if an exception is thrown by the application.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-02 16:42:40 +02:00
Greg Wilkins 7275bf15a9
Jetty 12.0.x core security (#9405)
core security module

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: gregw <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-02 15:35:49 +02:00
Joakim Erdfelt d10d54042a
Merge remote-tracking branch 'origin/jetty-12.0.x' into fix/12.0.x/hostheadercustomizer 2023-05-01 11:21:24 -05:00
gregw 063a3337d9 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-04-29 13:37:16 +02:00
Joakim Erdfelt 1225c66514
Remove ConnectionMetadata customization 2023-04-27 13:25:39 -05:00
Joakim Erdfelt 0211aa2483
Fix HostHeaderCustomizer and improve tests 2023-04-24 14:43:51 -05:00
Joakim Erdfelt 2831b0789d
Re-enable HalfCloseTest 2023-04-24 14:27:55 -05:00
Joakim Erdfelt 0bf42521eb
Re-enable ExternalServerTest with @Tag("external") 2023-04-24 14:26:29 -05:00
Joakim Erdfelt 4d86cce489
Re-enable StreamResetTest.testAsyncWriteAfterStreamReceivingReset 2023-04-24 14:18:54 -05:00
Joakim Erdfelt 64aa34aab5
Re-enable HttpClientTransportOverHTTP2Test.testExternalServer
+ and tag as `@Tag("external")` as appropriate
2023-04-24 14:17:29 -05:00
Joakim Erdfelt edc16869bd
Re-enable HTTP2CServerTest.testHTTP11Simple 2023-04-24 14:16:13 -05:00
Joakim Erdfelt 706c64fb6f
Re-enable BadURITest.testBadURI 2023-04-24 14:15:05 -05:00
Jan Bartel 5b4a0136b6
Remove unused session methods. (#9658) 2023-04-24 19:42:44 +10:00
Simone Bordet 7ffdd7fd05
Removed unnecessary "Adapter" classes.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-21 18:49:51 +02:00
Olivier Lamy 2a3b914570 mark flaky tests
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-04-21 15:50:49 +10:00
Olivier Lamy 46018e6057
Jetty-12.0.x tests in parallel (down build time on CI from 1h25 to 55min) some modules are still not parallel due to some static usage (#9635)
* parallel tests runs

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-04-21 10:42:12 +10:00
Greg Wilkins 0992e4cec4
Renamed "Core" environment to "Jetty" in `StartArgs` (#9641)
Maintained a "Core" environment for use by deployer for apps that only use core classes plus whatever else is configured for the core environment.
2023-04-14 14:25:50 +02:00
Ludovic Orban f28784fe0d #9410 Fix thread-safety of fail() implementations and buffer leaks
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-04-13 11:59:48 +02:00
Ludovic Orban 45db74eee0 #9410 Improved toString() and javadoc
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-04-13 11:59:48 +02:00
Simone Bordet 8fe3dbad16
Fixes #9438 - Jetty 12: Review JakartaWebSocketClientContainer use of… (#9626)
* Simplified the use of reflection.
* Improved `setShutdownContainer()` to take into account multiple web applications,
so it is now a `Map<ClassLoader, ContainerLifeCycle>` so that each web application
has its own container to register `JakartaWebSocketClientContainer` instances.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-13 09:50:18 +02:00
gregw 90de876770 Fixed default for #9444 2023-04-11 11:36:11 +02:00
Lachlan 7ebd07d18d
Merge pull request #9628 from eclipse/jetty-12.0.x-9554-Hpack-Qpack
Issue #9554 - move common hpack/qpack code to jetty-http
2023-04-11 16:07:52 +10:00
Joakim Erdfelt e927ad258b
Fixing compilation error 2023-04-10 15:25:56 -05:00
Joakim Erdfelt f94977084b
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-04-10 14:55:27 -05:00
gregw 0de2c60763 Fixed default for #9444 2023-04-10 18:01:58 +02:00
Simone Bordet ca2d85d8a0
Jetty 12 rehandle welcome files (#8856)
* Introduced WelcomeMode so that now welcome files can be redirected, served, or rehandled.
* Updated ResourceHandler and DefaultServlet accordingly.
* Introduced WelcomeServletMode to replace 2 booleans.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-08 18:59:18 +02:00
Simone Bordet 744b37f80b
Fixes #7608 - Jetty-12 MetaData cleanup needed (#9618)
* Removed unnecessary constructors from MetaData, MetaData.Request and MetaData.Response.
* Removed MetaData.Request.getURIString() (available as getHttpURI().toString()).
* Renamed MetaData.getFields() -> getHttpFields(), as they can be headers or trailers.
* Renamed MetaData.Request.getURI() -> getHttpURI().
* Normalized handling of contentLength, now always -1 (rather than Long.MIN_VALUE) if unknown.
* Permutated MetaData.Response constructor parameters to be consistent with MetaData.Request.
* MetaData.Request's method and httpURI must be non-null.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-07 21:23:01 +02:00
Simone Bordet 110e092a6e
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-06 16:18:58 +02:00
Joakim Erdfelt 06afedb851
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-04-05 16:10:43 -05:00
Ludovic Orban 98c1fe24a2 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-04-05 19:10:07 +02:00
Lachlan Roberts e187309c6c move huffman tables into separate class
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-05 21:13:30 +10:00
Lachlan Roberts 183291ee64 Issue #9554 - un-duplicate implementation for HPACK integer decoding.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-05 16:35:06 +10:00
Lachlan Roberts 7fb5b422fe Issue #9554 - un-duplicate implementation for HuffmanDecoder
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-05 16:04:04 +10:00
Lachlan Roberts f6688b0208 Issue #9554 - move Hpack/Qpack common classes to jetty-http
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-05 15:56:17 +10:00
Simone Bordet 2c74d93c56
Fixes #9550 - Jetty 12 - Flaky test WebSocketProxyTest.testEcho (#9553)
The fix is to make WebSocketUpgradeHandler.invocationType=BLOCKING, because the current semantic of the Jetty WebSocket APIs is that it is possible to call blocking APIs from within WebSocket event handler methods.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-04 15:42:12 +02:00
Greg Wilkins 8636666eec
Jetty 12 - Remove ISO-8859-1 fallback decoding during UTF-8 decoding (#9507)
* Deleted the Ut8fStringBuffer and Utf8Appendable classes in favour of just having Utf8StringBuilder
* Simplified the Utf8StringBuilder and CharsetStringBuilder APIs and improved their exception throwing.
* Allow for replacement characters without throwing

---------

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: gregw <gregw@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-04-04 10:57:07 +02:00
Greg Wilkins 693ac7ffbf
Jetty-12 Core Session listeners (#9499)
Added lifecycle and value listeners to jetty core session (needed for core security).

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2023-04-03 15:23:10 +02:00
Simone Bordet d65542da58
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-31 17:29:19 +02:00
Simone Bordet 99dc9c39f5
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-31 15:46:01 +02:00
Joakim Erdfelt 9b7763c9be
Jetty 12 - Review BOMs (#9551)
* Fixes #9467 - Review BOMs
* Skip deploy of select test artifacts
2023-03-29 16:34:02 -05:00
Ludovic Orban 46a250ebe8
#9538 - fixed testParallelContentSourceListenersTotalFailure (#9543)
* #9538 - fixed testParallelContentSourceListenersTotalFailure

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-03-29 23:00:45 +02:00
Joakim Erdfelt fadf58d615
Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x 2023-03-29 14:54:36 -05:00
Joakim Erdfelt fbc0e14abb
Turn off stacktrace logging for testFailServerUpgrade testcase 2023-03-29 14:54:26 -05:00
Simone Bordet 131bf775bd
Fixed flaky test `StreamResetTest.testClientResetConsumesQueuedData()`. (#9548)
The problem was that the retain/release idiom in HTTP2Session.onData()
was not respected.
Now after the call to HTTP2Stream.process(), the Data object is released.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-29 20:20:02 +02:00
Joakim Erdfelt 17b3ffe841
Issue #8740 - Move `org.eclipse.jetty.server.context.ManagedAttributes` to core `jetty-server` (#9549) 2023-03-29 13:01:52 -05:00
Joakim Erdfelt a5d863a0ad
Issue #9541 - Tagging new flaky test 2023-03-28 14:49:28 -05:00
Simone Bordet 6df856e053
Fixes retrieval of SSL Servlet request attributes. (#9533)
* Removed requestlog attributes that were never used.
* Code cleanups to remove usage of deprecated methods.
* Using MavenPaths.findTestResource* in ee9/ee10 tests to allow ee8 translation to function
* Fixed ClientCertAuthenticatorTest in both ee9 and ee10.
* Removed deprecated ClientCertAuthenticator in both ee9 and ee10.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-03-28 20:31:08 +02:00
Simone Bordet 0009ac4a91
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-28 20:23:53 +02:00
Simone Bordet f532be828f
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-28 20:22:56 +02:00
Simone Bordet 5facf1fa8a
Fixes #9539 - HttpClientTimeoutTest#testTimeoutOnFuture H3 logs exception. (#9541)
HTTP3Session.onClose() was calling failStreams(), which allocated
an IOException to fail the streams and eventually fail the response.
Since the failure was not a QuietException, it was logged at WARN level.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-27 11:31:16 +02:00
gregw edd86ef4a6 suppress correct stack
Signed-off-by: gregw <gregw@webtide.com>
2023-03-26 09:59:05 +02:00
Joakim Erdfelt 83b59ae718
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-03-24 13:44:13 -05:00
Simone Bordet 856d3338f2
Fixes #9391 - port/move Jetty WebSocket APIs, client and server to je… (#9469)
* Moved -api, -common, -client to jetty-core/jetty-websocket.
* Implemented jetty-core/jetty-websocket/jetty-websocket-jetty-server using only Jetty core APIs, not Servlet.
* Fixed Graceful shutdown order.
* Fixed mistakes in HttpFieldsWrapper, wrongly calling HttpHeader.name() instead of asString().
* Updated tests to pass cleanly.
* Fixed BOMs and POM dependencies.
* Introduced websocket-jetty.mod and websocket-jetty-client.mod, now used by ee10's Jetty WebSocket.
* Fixed OSGi references to old artifactIds.
* Added test to show how to lookup and use ServerWebSocketContainer from a Handler.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-24 19:42:51 +01:00
Lachlan Roberts 551fe7f1c4 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-SymlinkAllowedResourceAliasChecker-fix 2023-03-21 15:04:31 +11:00
Joakim Erdfelt 46cdb70449
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-03-20 12:05:57 -05:00
Simone Bordet 092a592278
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-20 10:22:23 +01:00
Lachlan Roberts a32d0fa125 Uncomment line in SymlinkAllowedResourceAliasChecker and add test for it.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-03-16 14:59:15 +09:00
Joakim Erdfelt 89a519b082
Fix flaky test 2023-03-15 11:31:25 -05:00
Joakim Erdfelt 71e94a57c0
Merge pull request #9481 from eclipse/fix/12.0.x/dependency-updates-report
Jetty 12 - Dependency Updates and Report Script
2023-03-14 06:06:56 -05:00
Greg Wilkins bd0186c2f7
Jetty 12.0.x 9444 servlet paths fully decoded (#9479)
getServletPath and getPathInfo will never return an encoded path segment. Instead, they will throw an IllegalArgumentException if they are called when there is a URI with violations.

Signed-off-by: gregw <gregw@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-03-11 14:13:09 +01:00
Greg Wilkins b63c5ef611
HttpMessage interface for BadMessageException
Convert class BadMessageException to a HttpMessage.RuntimeException to allows different types of HttpExceptions exceptions.
This follows the pattern of the QuietException interface.
2023-03-10 09:59:05 +01:00
Jan Bartel fc08390d4e Path can have no elements. 2023-03-09 17:18:19 +01:00
Jan Bartel f9a018105d
Issue #9459 empty session path in cookie (#9477) 2023-03-10 00:38:52 +11:00
Joakim Erdfelt 20404f760c
<onlyUpgradable> set to true 2023-03-09 06:36:35 -06:00
Joakim Erdfelt 7f52d4f3f0
Set <onlyProjectDependencies> config to true 2023-03-08 16:13:27 -06:00
Joakim Erdfelt 0feff8d35a
Ignoring jetty releases and maven alpha/beta versions 2023-03-08 16:08:09 -06:00
Joakim Erdfelt d66058732f
Initial Dependency Update Reports 2023-03-08 15:12:28 -06:00
Joakim Erdfelt 0099491435
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-03-08 14:31:45 -06:00
Greg Wilkins 916cd9894d
Decode safe Path for #9444 (#9455)
Added URIUtil.decodeSafePath for EE10, to allow for %2F and %25 to remain encoded in the servlet API.
Fixed async dispatch to also safeDecode
Updated tests to expect decoded space
Apply suggestions from code review

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-03 14:36:19 +01:00
Greg Wilkins 474136de57 #9311 Add Queued and Compound Pool implementations
This adds a QueuedPool that can wrap any other pool and provided a queue of Entries as a kind of cache.
2023-02-27 13:37:53 +01:00
Ludovic Orban e819809723
Fix `HugeResourceTest` (#9411)
#9408: restored HugeResourceTest:
 - fixed double-release bug in MultiPartFormData
 - used ByteBufferPool.NonPooling pool to work around #9311

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-27 09:12:50 +01:00
Simone Bordet e4c46b1e14
Fixes #9440 - Jetty 12: HttpCookieStore should return cookies for "ws" schemes (#9441)
Now only using whether the scheme is secure in the key used to store cookies,
not the scheme string.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-26 23:06:03 +01:00
Greg Wilkins 6c114b00db
Improve CookieCompliance testing (#9399)
Improved handling of CookieCompliance.from method
Added tests for request and response cookie handling
Use from in jetty.xml

Signed-off-by: gregw <gregw@webtide.com>
2023-02-23 20:35:51 +11:00
Jan Bartel 3f24cc4f0a Fix bad merges from jetty-11 2023-02-22 16:45:07 +11:00
Jan Bartel ed04e19282 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-02-22 16:18:07 +11:00
gregw af8bd97f55 Fixed Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/RFC6265CookieParserLenientTest.java
#	jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/RFC6265CookieParserTest.java
#	jetty-core/jetty-server/src/main/config/etc/jetty.xml
#	jetty-core/jetty-server/src/test/java/org/eclipse/jetty/server/ServerHttpCookieTest.java
#	jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/Cookies.java
#	jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java
#	pom.xml
2023-02-21 22:17:21 +11:00
gregw e7d3181e7b fixing merge
Signed-off-by: gregw <gregw@webtide.com>
2023-02-21 22:09:51 +11:00
gregw b720d65f4f Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-02-21 22:01:31 +11:00
gregw 3bdd75f682 Set server on default handler
Fixes #9398 and #9322
2023-02-20 19:22:11 +11:00
Lachlan 81046650ab
Merge pull request #9356 from eclipse/jetty-12.0.x-websocket-JPMS
cleanup of websocket to fix JPMS warnings
2023-02-17 15:30:54 +11:00
Lachlan Roberts 41d550047f ensure the WebSocketConnection is set on the WebSocketCoreSession
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 14:05:48 +11:00
Lachlan Roberts 05fb8127d9 remove osgi internal imports for websocket-core
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 11:41:03 +11:00
Lachlan Roberts 229b300f22 rename WebSocketUtil to WebSocketUtils
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 11:37:01 +11:00
Lachlan Roberts eb493f1b9d make WebSocketCoreSession public & other fixes
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 11:33:02 +11:00
Simone Bordet a8737cd170
Javadocs for Response and Context. (#9388)
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-02-17 10:47:16 +11:00
Simone Bordet d21f38798e
Moved implementation methods ensure*() from the Response interface (#9390)
to ResponseUtils to avoid cluttering the main Response interface.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-17 08:50:46 +11:00
gregw af78d13030 Fix #9387 2023-02-17 08:11:55 +11:00
Greg Wilkins 0ca6295cbc
Rename process to handle (#9385)
Renamed Request.Processor to Request.Handler
Renamed Handler.process to Handler.handle
Renamed Rule.Processor to Rule.Handler.
Renamed accordingly methods and variable.
Updated comments accordingly.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-16 18:21:12 +01:00
Lachlan Roberts 0742202ce2 remove setClassLoader from CoreSession interface
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-16 13:16:00 +11:00
Lachlan b0fa9e20cb
Merge pull request #9357 from eclipse/jetty-12.0.x-9336-ChunksPart
Issue #9336 - remember ContentSources to fail from ChunksPart
2023-02-16 10:40:08 +11:00
Lachlan Roberts 5775887786 Issue #9336 - remember ContentSources to fail from ChunksPart
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-15 23:24:47 +11:00
gregw 033de8611b Fixed FormAuthenticator redirection
Response redirect now correctly consumes content
2023-02-15 17:48:39 +11:00
Lachlan Roberts 43718f3e52 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-websocket-JPMS 2023-02-15 17:12:59 +11:00
Lachlan Roberts e25c936802 remove exporting of internal packages in ee9 & ee10 websocket
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-15 16:59:29 +11:00
gregw a15af55a56 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: gregw <gregw@webtide.com>
2023-02-15 15:31:33 +11:00
Jan Bartel b9b26e2a82
Jetty 12 - Restore ee10 tests (#9214)
* Restore jetty-ee10-test-http2-webapp and jetty-ee10-test-integration modules

Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-15 14:24:55 +11:00
gregw 015e3d761c Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/CookieCutter.java
#	jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/CookieParser.java
#	jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/RFC6265CookieParser.java
#	jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterTest.java
#	jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/CookieParserTest.java
#	jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/RFC6265CookieParserTest.java
#	jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/Cookies.java
#	jetty-http/src/main/java/org/eclipse/jetty/http/HttpCookie.java
#	jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterLenientTest.java
2023-02-15 14:22:38 +11:00
gregw 0ac3c3f7e6 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-02-14 18:09:33 +11:00
Lachlan Roberts ce270cf34b fix remaining JPMS issues in websocket-core
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-14 17:25:15 +11:00
Lachlan Roberts 1d8e13220a resolve JPMS issues with CoreSession and WebSocketCoreSession
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-14 15:34:53 +11:00
Olivier Lamy 0387c6ddbc Merge branch 'jetty-11.0.x' into jetty-12.0.x 2023-02-14 09:38:28 +10:00
gregw 4aa6bca630 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-core/jetty-server/src/test/java/org/eclipse/jetty/server/ForwardedRequestCustomizerTest.java
#	jetty-ee9/jetty-ee9-nested/src/main/java/org/eclipse/jetty/ee9/nested/Request.java
#	jetty-ee9/jetty-ee9-nested/src/test/java/org/eclipse/jetty/ee9/nested/RequestTest.java
2023-02-14 10:07:18 +11:00
Lachlan Roberts cc40a545dc move websocket-core-common messages and util packages out of internal
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-14 09:43:25 +11:00
Simone Bordet e5b313e379
Jetty 12 - Review client notifiers (#9335)
* Introduced ResponseListeners to reduce per-request allocation.
* Removed ResponseNotifier in favor of ResponseListeners.
* Introduced RequestListeners to reduce the per-request allocation.
* Removed RequestNotifier in favor of RequestListeners.
* Removed unnecessary sharing of HttpRequest.requestListeners.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-13 17:36:29 +01:00
Simone Bordet 4db0c70735 Fixes #9326 - Rename DecryptedEndPoint to SslEndPoint.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-09 22:17:51 +01:00
Lachlan Roberts 2d11517dd6 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-websocket-autodemanding 2023-02-09 18:22:49 +11:00
Lachlan Roberts 5e72c568d0 #9328 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-09 18:20:37 +11:00
Lachlan 3259a55ce3
Merge pull request #9287 from eclipse/jetty-12.0.x-multipartCleanups
Issue #9076 - Cleanups and fixes for multipart in Jetty 12
2023-02-09 18:10:01 +11:00
Lachlan 3ed9302c0f
Merge pull request #9235 from eclipse/jetty-12.0.x-9233-core-common-util-cleanup
Issue #9233 - cleanup of websocket-core-common util package
2023-02-09 15:52:21 +11:00
Simone Bordet 83d6e1756e
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-08 10:37:31 +01:00
Lachlan Roberts 1e92759578 #9287 - remove unpaired release of Content.Chunk
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-08 16:51:39 +11:00
Lachlan Roberts d2dcbeba5b Issue #8991 - rename websocket isDemanding() method to isAutoDemanding()
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-08 14:18:02 +11:00
Lachlan Roberts cb511bed8a Issue #9287 - fix failing tests
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-08 13:58:18 +11:00
Lachlan Roberts 6950d73fce Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-multipartCleanups 2023-02-08 11:55:37 +11:00
Ludovic Orban b87f9385c8
Jetty 12: Cleanup `StatisticsHandler` (#9291)
#9145 cleanup statistics

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-07 17:43:46 +01:00
Simone Bordet d02932f690
Fixes #9288 - Jetty 12 - Use oej.http.HttpCookie in jetty-client. (#9289)
* Replaced usages of java.net.HttpCookie with oej.http.HttpCookie.
* Moved server-side only methods from HttpCookie to HttpCookieUtils.
* Introduced and implemented oej.http.HttpCookieStore.
* Removed now obsolete oej.util.HttpCookieStore.
* Introduced HttpScheme.isSecure(String), to avoid code duplication.
* Fixed handling of cookie "localhost" domain in HttpClient.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-07 17:28:01 +01:00
Greg Wilkins f565122571
Redo Handler renaming (#9318)
* Redo Handler renaming

Wrapper to Singleton
BaseWrapper to Wrapper

* Updates from review
2023-02-07 16:41:15 +11:00
Lachlan Roberts d005e975b0 changes f rom review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-07 15:47:17 +11:00
Greg Wilkins d901237e07 fixed style
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2023-02-07 08:14:37 +11:00
Greg Wilkins 461c306fcf cleanup TODOs for decoration
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2023-02-07 07:46:03 +11:00
Simone Bordet 5cc07994c0
Issue #9300 - Rename RetainableByteBufferPool to ByteBufferPool
ArrayRetainableByteBufferPool -> ArrayByteBufferPool.
Updated field names.
Updates tests.
Updated *.mod files to not reference RetainableByteBufferPool.
Updated javadocs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-06 10:31:14 +01:00
Simone Bordet 44980ebfc3
Merge branch 'issue/9284' of https://github.com/kohlschuetter/jetty.project into kohlschuetter-issue/9284 2023-02-06 10:16:32 +01:00
Greg Wilkins 60a08f5349
Rename Handler Nested & Collection (#9305)
There is now a Handler interface hierarchy:
 + Container is a Handler that has 1 or more contained Handlers.
 + Wrapper is a Container with only 1 handler and a setHandler method.
 + Collection is a Container with n handlers and a addHandler method

class are now:
 + Abstract implements Handler
 + AbstractContainer extends Abstract implements Container
 + BaseWrapper extends AbstractContainer implements Wrapper
 + Sequence extends AbstractContainer implements Collection

 Lots of other associated cleanups
2023-02-06 12:15:35 +11:00
Lachlan Roberts c7e7fd837c Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-multipartCleanups 2023-02-06 11:18:19 +11:00
Olivier Lamy 377798ff50
fix surefire jpms configuration
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-05 17:10:36 +10:00
Olivier Lamy dedcfe1d22
fix merge
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-05 16:48:22 +10:00
Olivier Lamy 4812eb1c89
Merge branch 'jetty-11.0.x' into jetty-12.0.x-merg 2023-02-05 16:34:58 +10:00
Olivier Lamy a600506155
fix merge
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-05 16:08:11 +10:00
dependabot[bot] 44cd3ee541
Bump maven.surefire.plugin.version from 3.0.0-M5 to 3.0.0-M8 (#9255) 2023-02-05 15:58:03 +10:00
Christian Kohlschütter b8ab66fd1d Rename RetainableByteBufferPool to ByteBufferPool
With issue #9166, ByteBufferPool was removed and replaced by
RetainableByteBufferPool. Since ByteBufferPool was used by
AbstractConnector, this change broke backwards compatibility with
third-party connectors such as junixsocket-jetty.

Since there's no longer any other ByteBufferPool, rename the
RetainableByteBufferPool interface, and thereby not only reinstate
compatibility with existing third-party libraries but also save a few
keystrokes.

https://github.com/eclipse/jetty.project/issues/9284

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>
2023-02-04 23:39:29 +01:00
Simone Bordet 9916706b5f
Issue #9293 - Jetty 12 - Relax JPMS dependencies (quic) (#9307)
Relaxed jetty-quic JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-04 14:38:33 +01:00
Simone Bordet c18194b20f
Issue #9293 - Jetty 12 - Relax JPMS dependencies (fcgi) (#9306)
Relaxed jetty-fcgi JPMS dependencies.
Packages generator and parser were not internal,
was just matters of exporting them.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-04 14:38:08 +01:00
Lachlan Roberts cd47a07463 use non-pooling RetainableByteBufferPool to work around performance bug
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-04 00:49:59 +11:00
Simone Bordet 55a27fc68c
Issue #9293 - Jetty 12 - Relax JPMS dependencies. (#9296)
Relaxed jetty-http2 and submodules JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-03 10:19:41 +01:00
Simone Bordet ec41480aed
Issue #9293 - Jetty 12 - Relax JPMS dependencies. (#9299)
* Issue #9293 - Jetty 12 - Relax JPMS dependencies.

Relaxed jetty-http3 and submodules JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-03 10:16:29 +01:00
Olivier Lamy 109dd70d67
fix dependency
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-03 19:07:26 +10:00
Simone Bordet 36b41af560
Merge pull request #9294 from eclipse/fix/jetty-12-client-jpms
Issue #9293 - Jetty 12 - Relax JPMS dependencies.
2023-02-03 09:55:35 +01:00
Olivier Lamy 0d485fbe28
this dependency is used in test scope
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-03 18:45:29 +10:00
Lachlan 1144d3a18f
Merge pull request #9234 from eclipse/jetty-12.0.x-websocket-core-server-jpms
Issue #9233 - Fix some JPMS issues for websocket-core
2023-02-03 14:05:34 +11:00
Olivier Lamy b93a115ecd
Jetty 12 - Rename sessions tests with ee# version in package name (#9231)
* rename sessions tests with eeX version in package name as it, we can indentify which test is failing with junit result
* get rid of some duplicate classes

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-02-03 10:49:44 +10:00
Simone Bordet cd5031b15f
Issue #9293 - Jetty 12 - Relax JPMS dependencies.
Relaxed jetty-client JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-02 19:30:40 +01:00
Greg Wilkins ebc6cca478
Jetty 12 - Added a core Session abstraction (#9223)
* Added a core Session abstraction

Sessions were already a core mechanism, but there was no API for them.
There is now a new Session interface that is available via the Request API.  It is intended only for users of sessions.
The previous concrete class Session has been renamed to ManagedSession and it is used by classes that extend AbstractSessionManager.

* Fixed tests

* Use static method

* Updates from review

* Updates from review

Improved javadoc
used util Attributes interface.
2023-02-02 21:40:17 +11:00
Ludovic Orban b1739aca53 Catch unchecked exceptions / errors thrown during produce to avoid letting the stack trace be logged by the execution strategy
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-02 10:42:20 +01:00
Joakim Erdfelt 490f86e9a6
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-02-01 19:33:43 -06:00
Ludovic Orban e68c827c2d
Fix connection pool's forcible stop (#9280)
* #9275 fix forcible closure of connections upon stopping the connection pool


Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-02 08:36:00 +11:00
Ludovic Orban 9295f93bd8 #9240 add null checks to methods that can be used on a stopped pool
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-01 18:43:02 +01:00
Greg Wilkins f4d5741b02 suppress stack
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2023-02-01 16:07:51 +11:00
Lachlan Roberts d66e36b746 consumeAvailable should use number of reads instead of bytes
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-01 14:59:29 +11:00
Ludovic Orban a22270b4a5
Jetty 12.0.x silence tests' stacktraces (#9225)
* silence stack traces in IdleTimeoutTest by refactoring test + avoid execution of handlers over closed streams

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-01 14:43:50 +11:00
Lachlan Roberts 4ffad09335 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-9066-MultiPart-getParameters 2023-02-01 12:42:35 +11:00
Lachlan Roberts 88c6f20199 changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-01 12:08:38 +11:00
Lachlan Roberts c9004ee68c restore the resolveGenericRef with Class
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-01 11:27:49 +11:00
Lachlan Roberts 4933ba9aec cleanups of websocket-core-common util package
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-31 20:34:02 +11:00
Lachlan Roberts 9113624ab4 cleanups of websocket-core-common util package
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-31 20:26:09 +11:00
Lachlan Roberts 96fc36ca64 fix some jpms issues for websocket-core
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-31 20:09:51 +11:00
Lachlan Roberts 8133dd6c9e changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-31 14:29:42 +11:00
Lachlan Roberts 719c60d70d changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-31 11:42:40 +11:00
Greg Wilkins 50a88187fa
Jetty 12 - New HTTP Cookie interface (#9205)
Convert HttpCookie to an interface.
2023-01-31 10:02:28 +11:00
Greg Wilkins c871fa4402
Converted PathMappings to be an AbstractMap (#9213)
This was primarily done to avoid surprise of the previous behaviour of puts for a duplicate key being ignored.
The use of the AbstractMap class now provides javadoc and known/expected behaviour for key methods.
The only significant behaviour change is in the return type of some key methods, with the old/previous value replacing a boolean.
Some stream usage has also been replaced by the more efficient iterator.
2023-01-31 09:19:01 +11:00
Simone Bordet ae43c1f830
Fixed DetectorConnection buffer lifecycle. (#9227)
* Fixed DetectorConnection buffer lifecycle.

Now `detectAndUpgrade()` does not do any buffer lifecycle.
The buffer lifecycle is handled by the callers of `detectAndUpgrade()`.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-30 16:57:40 +01:00
Simone Bordet af6ecfebfe
Fixes #9210 - Jetty 12 - Review Pool and Pool.Entry (#9211)
* Fixes #9210 - Jetty 12 - Review Pool and Pool.Entry

* Extracted interface Pool, renamed implementation to ConcurrentPool.
* Extracted Pool.Entry as interface.
* Moved StrategyType to ConcurrentPool.
* Made Pool.Factory.wrap() work in order to wrap Pool instances.
* Removed constructors that were explicitly taking Pool parameters, replaced by a single Pool.Factory parameter.
* Added javadocs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-30 10:11:29 +01:00
Lachlan Roberts 738712438c changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-30 13:20:51 +11:00
Simone Bordet cd732a175c
Review and normalized all Maven module <name> for consistency.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 19:09:30 +01:00
Ludovic Orban 2424c86b34 #9145 fix websocket modules
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-27 17:44:09 +01:00
Simone Bordet ded18f523d
Fixes #9166 - Jetty 12: review/remove ByteBufferPool (#9195)
* Fixes #9166 - Jetty 12: review/remove ByteBufferPool

* Replaced usages of ByteBufferPool with RetainableByteBufferPool.
* Removed ByteBufferPool and related classes.
* Renamed oej.http2.frames.DataFrame.getData() -> getByteBuffer() for consistency.
* Removed Accumulator.acquire(), and updated code to use RetainableByteBufferPool.acquire() instead.
* Fixed HttpOutput callbacks to correctly call super.onCompleteSuccess() and super.onCompleteFailure().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 13:40:49 +01:00
Joakim Erdfelt 7f0294d4e5
Jetty 12 - Move test JPMS out of main `module-info.java` (#9203)
* Move test jpms out of main module-info.java
* There's no jetty-core/jetty-security anymore
2023-01-26 09:26:27 -06:00
Joakim Erdfelt 177fc234ef
Removing `@Disabled` on `SecuredRedirectHandlerTest` (#9208)
* Removing @Disabled on `SecuredRedirectHandler`
* Fixing javadoc
2023-01-26 09:26:09 -06:00
Joakim Erdfelt 08b9d6b8d9
Jetty 12 - Fixing simple `@named` virtualhost configuration (#9207)
* Fixing simple `@named` virtualhost configuration
* Fixing javadoc comment
2023-01-25 16:11:45 -06:00
Joakim Erdfelt c3ed8134dd
Adding javadoc 2023-01-25 16:06:35 -06:00
Joakim Erdfelt 81f7031cfe
Jetty 12 - Cleanup Shutdown classes (#9201)
* Fixed ShutdownHandler in jetty-core
* Delete ee9 ShutdownHandler
* Rename GracefulShutdownHandler to just GracefulHandler
* Adding graceful Jetty module
* Improved Javadoc + Token encoding tests
2023-01-25 13:54:53 -06:00
Lachlan Roberts 36e7f71def Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-9066-MultiPart-getParameters 2023-01-25 14:23:37 +11:00
Lachlan Roberts 2dfe7e6021 fix some more tests in MultiPartServletTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-25 10:49:30 +11:00
Lachlan Roberts d4682f4b85 Fix testMaxRequest size test in MultiPartServletTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-25 10:39:20 +11:00
Joakim Erdfelt 7d8dd946cc
Add and allow plural form of existing args. (#9202)
+ new `--modules=<name>,<name>`
+ new `--libs=<classpath>`
+ updated usage.txt
+ updated warning output hint
2023-01-24 16:02:26 -06:00
Greg Wilkins 39e5667f1d
Jetty-12 Remove usage of HandlerList and reduce usage of Handler.Collection (#9191)
* Remove usage of HandlerList and reduce usage of Handler.Collection

"The best part is no part" - Elon Musk!

The overwhelming usage of `HandlerList` and `Handler.Collection` was for adding the `DefaultHandler` after the main handler.  This PR adds a getter/setter for a `DefaultHandler` on the server, so we no longer need to always create a `Handler.Collection` structure.   This has allowed the deprecated `HandlerList` and `HandlerWrapper` classes to be removed.

In implementing this PR, several problems were found in the calculation of `InvocationType`, not least that it was assumed that an empty `Handler.Collection` was `BLOCKING`.  When this issue was fixed, any dynamic addition of contexts (deployer or SPI server) failed as the `InvocationType` changed.  So this PR also introduces the `isDynamic()` attribute of all `Handler.Container`s.  A dynamic container will always return `BLOCKING` from `getInvocationType()`, as there is always a race with a new handler being added.   A non-dynamic container will return a real `InvocationType`, calculated from its children, but it's mutator methods will ISE if contained handlers are changed.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-25 08:08:09 +11:00
Joakim Erdfelt 53fc33161d
Remove junit internals usage. 2023-01-24 13:46:48 -06:00
Simone Bordet 8076aa10e7
Fixes implicit narrowing conversion reported in #9166.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-23 19:51:53 +01:00
Joakim Erdfelt 26a4ee5454
Jetty 12 - Introduce `GracefulShutdownHandler` and Test (#9174)
* Introduce GracefulShutdownHandler and test

+ started with removing `@Disabled` from `GracefulStopTest.java`
+ GracefulShutdownHandler based on Callback manipulation
2023-01-23 09:17:27 -06:00
Joakim Erdfelt 7920102702
Issue #9173 - Make wrapping of `ServletApiResponse` easier (#9175)
* Issue #9173 - Make wrapping of ServletApiResponse easier

* Fixing checkstyle and missing licenses
* Improved HttpCookie with javadoc and attribute handling
2023-01-23 08:23:30 -06:00
Greg Wilkins 99fdd219b7
Jetty 12.0.x 9131 remove path watcher (#9158)
* Reverted to Scanner for PropertyUserStore
* Remove PathWatcher from unassembled fork mode.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
2023-01-20 08:03:27 +11:00
Greg Poulos 06efbcaa7c
Jetty 12.0.x document modules (#9151)
* Add documentation in "Standard Modules" section for the jmx module
* Add documentation in "Standard Modules" section for the ee8,9,10-webapp modules
* Use shorter markup tags to transclude documentation from .mod files
* Extract EE version strings into variables
* Replace literal usages of EE version numbers with custom attribute
* Use convention 'eeN' instead of 'eex' in filenames
* Update metadata tag for deploy module documentation
* Update deploy module documentation to discuss EE platform-specific deploy modules
* Add documentation for the resources module
* Add resources module into section table of contents
* Use jetty-home instead of JETTY_HOME as documentation attribute

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 19:02:42 +01:00
Joakim Erdfelt fc762aea7d
Remove `@Disabled` from more `jetty-core/jetty-server` tests (#9162)
* Remove @Disabled from ConnectorTimeoutTests
* Remove @Disabled from SlowClientsTest
* Remove @Disabled from SslConnectionFactoryTest
* Remove @Disabled from DetectorConnectionTest
* Disabling quiche from checkstyle
* Removing ConnectorTimeoutTest BlockingTimeout tests
  + The concept of HttpConfiguration.blockingTimeout
     has been removed, these tests are no longer relevant
2023-01-19 10:31:51 -06:00
Joakim Erdfelt a37b8523e5
Jetty 12 - Javadoc cleanup & new inspection profile (#9165)
* Adding intellij-javadoc-inspection.xml for Jetty specific Javadoc inspection profile.
* Javadoc cleanup
2023-01-19 10:31:27 -06:00
Simone Bordet 0a002d7785
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-19 15:23:13 +01:00
Ludovic Orban f3c229437a
Add latency recording utility handler (#9172)
* #8069 add latency recording handler

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-19 10:27:05 +01:00
Joakim Erdfelt a06d1a29bb
Jetty 12 - Fix for HttpParser quick HTTP Version lookahead (#9171)
+ Removed the array optimized look ahead
+ version lookahead now done with getInt
+ improved test harness to check lf and crlf endings
+ added HTTP as int optimization
+ fixed bug in near miss of field cache

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-01-18 09:37:55 +11:00
Joakim Erdfelt 6d1e244af6
Merge pull request #9136 from kohlschuetter/jetty-12-NativeImageResourcePath2
* util: Add support for GraalVM Native-Image resource:-URIs and Paths

GraalVM Native-Image makes its classpath resources accessible through an
opaque resource: URL scheme.

Add support for this scheme in URIUtil and PathResource.

Automatically create the NativeImageResourceFileSystem when necessary.
Also add a workaround where converting such Native-Image Paths back to
URI would yield the wrong URI (potentially a bug in GraalVM).

https://github.com/eclipse/jetty.project/issues/9116
https://github.com/oracle/graal/issues/5720

* URIUtil: Suppress CodeQL false positive error about path injection

Github CodeQL code scanning reports a high-severity error "Uncontrolled
data used in path expression", because a path depends on a user-provided
value.

This is a false positive.

Suppress the error by annotating a corresponding @SuppressWarnings tag.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* URIUtil: Removed unused code

KNOWN_SCHEMES isn't used anywhere.

* PathResource: Selectively enable resource: for GraalVM Native Image

In regular HotSpot VMs, the resource: scheme may be registered by other
clients. However, in GraalVM Native Image, this is used for classpath
resources.

This resource scheme needs to be enabled by default for Native Image
environments so we can support code that is unaware of GraalVM
internals, such as:

URL resourceURL = MyClass.class.getResource("some/resource");
Resource resource = ResourceFactory.root().newResource(resourceURL);

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* PathResourceFactory: Ignore certain RuntimeExceptions upon init

Ignore FileSystemAlreadyExistsException, ProviderNotFoundException, etc.
that may be thrown upon calling FileSystems.newFileSystem.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* PathResource: Work-around false positive CodeQL warning

CodeQL prevents amending the call to Paths.get.

Work-around this by using a separate constructor. The additional benefit
is that URIUtil.correctResourceURI won't need to correct the URI twice.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* PathResource: Fix "isAlias" issue with resource: URIs

Fix two more places where Native Image resource: URIs need to be
changed.

Without this change, Resource#isAlias() would return true for such URIs,
and a warning like "BaseResource resource:/some/package/ is aliased to
resource:file:///resources!/some/package/" would be logged.

* Move GraalVM Native-Image code to NativeImagePathResource/-Factory

Keep the GraalVM Native-Image code contained in custom subclasses.

We still enable the "resource:" URL scheme by default if a GraalVM
Native-Image environment is detected via System property. This allows us
to transparently support calls like
ResourceFactory.root().newResource(MyClass.class.getResorce("webapp"))

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* Refactor Graal native-image resource: handling

Detect the resource: scheme by checking the scheme of a well-known
resource instead of looking at a system property.

Rename NativeImagePathResource* to GraalIssue5720PathResource* and make
these classes package-private.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>

* Only use GraalIssue5720PathResourceFactory when truly needed

Previously, we were always enabling this resource factory for GraalVM
native-image environments.

We now check if that's actually necessary.

We fall back to MountedPathResourceFactory or PathResourceFactory,
depending on whether the URL contains "!/" or not.

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>
2023-01-17 13:08:50 -06:00
Greg Wilkins a4ee42944b suppress test stacks 2023-01-17 16:58:55 +11:00
Lachlan Roberts 539113df7c Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-9066-MultiPart-getParameters 2023-01-17 15:12:38 +11:00
Lachlan Roberts 5bcfeaac09 improvements to multipart
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-17 14:09:45 +11:00
Greg Wilkins 94991c60c0
Jetty 12 temp directory cleanup (#9153)
+ `Server` now has setter/getter for a temp directory, which can be null
 + `Context` now has a getter for a temp directory, which is never null 
 + Server root Context temp directory is either whatever is set, else a work directory, else java.io.tmpdir
 + WebInfConfiguration will still create a temp directory name, but defers to ContextHandler for creation/persistence of the temp directory
 + temp directory (and BASE) removed from the deployer, as it is now the server temp directory.
2023-01-17 11:44:09 +11:00
Christian Kohlschütter cdea111d3f Only use GraalIssue5720PathResourceFactory when truly needed
Previously, we were always enabling this resource factory for GraalVM
native-image environments.

We now check if that's actually necessary.

We fall back to MountedPathResourceFactory or PathResourceFactory,
depending on whether the URL contains "!/" or not.
2023-01-16 23:27:53 +01:00
Christian Kohlschütter 30ffbcb7e4 Merge remote-tracking branch 'upstream/jetty-12.0.x' into jetty-12-NativeImageResourcePath2 2023-01-16 18:48:04 +01:00
Joakim Erdfelt be3b8f0b9d
Issue #9167 - making assumption in flaky test 2023-01-16 11:33:43 -06:00
Lachlan Roberts 1e20abc902 improvements to multipart
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-16 19:07:51 +11:00
Olivier Lamy 58f5e468fc
jetty 12.0.x cleanup duplicate osgi pom metadata (#9093)
* fix naming convention, artifactId == directtory, add comment on maven-eclipse-plugin
* cleanup dependencies from jetty-ee9 osgi
* cleanup dependencies from jetty-ee10 osgi
* remove maven-eclipse-plugin configuration
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-01-16 11:39:37 +10:00
Lachlan Roberts 3816e4b98a fix multipart test cases, add more api to the core MultiPart class
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-16 11:52:04 +11:00
Joakim Erdfelt 8374860661
Jetty 12 - Add tests in util/resource for alternate FileSystem implementations (#9149)
* Add tests in util/resource for alternate FileSystem implementations
2023-01-13 09:45:42 -06:00
Greg Wilkins 8b3bcc3a50
Cleanup non-retainable `Retainable`s (#9159)
`Retainable`s that return false from `canRetain()` now are noops if `retain()` is called, which allows for a simpler calling convention.
`AsyncContent` has also been reworked to allocate less and be clearer in its use of `canRetain()`.
2023-01-13 10:37:16 +01:00
Simone Bordet 46355c6110
Fixes retainability of special Chunks (#9073)
* Fixes #8993 - Retainability of special Chunks

* Restored Jetty 11's AsyncContentProducer and related classes in jetty-ee9-nested module (src and test).
* Introduced Retainable.canRetain().
* Removed Chunk.isTerminal() and replaced it with alternative method calls.
* Clarified AsyncContent.write() in case of Chunk.Error.
* Removed AsyncContent.write(Chunk, Callback) because it was making the API confusing.
  For example, AsyncContent.close() clashing with write(EOF, NOOP), or
  AsyncContent.fail(x) clashing with write(Chunk.Error, NOOP), etc.
* Improved usage of Chunk.from(..., Retainable).
* Improved usage of Chunk.slice().
* Using from() in MultiPart, rather than duplicating code.
* Fixed MultiPart.Parser.Listener.onPartContent() javadocs.
* Renamed non-retaining Chunk.from() to Chunk.asChunk().
* Removed Chunk.slice() methods, inlining them where necessary.
* Carefully reviewed all usages of read()-like methods that return a Retainable instance to make sure it is released.
* Updated HTTP/2 and HTTP/3 usages of Stream.Data to follow the correct retain/release semantic.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-13 01:10:56 +01:00
Lachlan Roberts 02f9cc0eb3 fixes to pass new multipart test cases
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-12 19:21:00 +11:00
Olivier Lamy de1f74b132
Merge branch 'jetty-11.0.x' into jetty-12.0.x 2023-01-12 10:31:05 +08:00
Joakim Erdfelt 3c63ff2dc6
Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x 2023-01-11 08:17:47 -06:00
Joakim Erdfelt dfd214debe
More fundamental test case 2023-01-11 08:17:37 -06:00
Simone Bordet a1c5cefd0d
Reorganization of jetty-client classes. (#9127)
* Reorganization of jetty-client classes.

* Moved oej.client.api to oej.client
* Moved oej.client.util to oej.client
* Moved implementation classes to oej.client.internal
* Moved transports to oej.client.transport
* Moved transport implementation classes to oej.client.transport.internal
* Moved TunnelRequest to oej.client.internal.

* Moved FastCGI transport classes to o.e.j.fcgi.transport
* Moved FastCGI transport implementation classes to o.e.j.fcgi.transport.internal

* Updated WebSocket core client to use only exported, non-internal, oej.client classes.

* Expanded oej.client.Destination APIs:
  - added: getOrigin(), isSecure(), getProxy(), getConnectionPool(), getHttpClient(), send(..).
  - removed: getScheme(), getHost(), getPort() because they don't uniquely identify a Destination anymore (Origin does)
* Moved destination sweeper functionality from HttpDestination to HttpClient.
  HttpDestination does not implement close() anymore, now relies on LifeCycle.stop()
* Moved HttpReceiver.storeCookie() logic to HttpClient.putCookie() to avoid exposing CookieManager.
* Moved HttpClient.getAcceptEncodingField() to ContentDecoder.Factories

* Avoid public/protected Logger instances.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-11 10:05:43 +01:00
Joakim Erdfelt 03569efb6c
Removing @Disabled from SslUploadTest 2023-01-10 16:27:09 -06:00
Joakim Erdfelt 0a5c143590
Removing @Disabled from jetty-start 2023-01-10 16:16:13 -06:00