Commit Graph

29031 Commits

Author SHA1 Message Date
Jan Bartel 03425a2bd5 Change 2023-11-29 19:13:12 +11:00
Jan Bartel f6eac3ebbc Issue #10925 More updates to jetty maven plugin documentation. 2023-11-29 18:53:58 +11:00
Jan Bartel df42cb276d
Improve Resource use in MetaInfConfiguration (#10889)
* Reduce resources kept open by MetaInfConfiguration
---------

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2023-11-29 02:11:47 +01:00
Greg Wilkins 41382b4e0e
Fix null host when checking virtual host #10922 (#10923)
Use the `Request.getServerName` static and check for null host.
2023-11-29 11:25:00 +11:00
Simone Bordet d1da7269f6
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-28 15:58:48 +01:00
Simone Bordet e82efe5c81
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-28 15:57:59 +01:00
Simone Bordet 573ea67cda
Fixed locking.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-28 15:57:19 +01:00
Simone Bordet 8c10ea8a9b
Fixes #10912 - Document Request listeners (#10920)
* Fixes #10912 - Document Request listeners

* Documented Request listeners and updated javadocs.
* Removed code in HttpChannelState.onIdleTimeout() that was automatically complete the Handler callback.
* Invoking failure listeners only once (although HttpChannelState.onFailure() may be called multiple times).
* Made sure that in ChannelCallback.succeeded() the last stream send uses the ChannelResponse as Callback, like it is done in Response.write().
* Moved Request listeners tests from various test classes into RequestListenersTest.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-28 12:56:17 +01:00
Ludovic Orban 5a273f0d3e
Align Core, ee9 and ee10 `AbstractTest` and fix ee9 H3 tests (#10929)
* #10386 Align core, ee9 and ee10 AbstractTest:
 - use the same temporary folder technique
 - configure the SSL contexts the same way

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-27 17:14:31 +01:00
Simone Bordet c6fa7a8766
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-27 15:41:17 +01:00
Simone Bordet 6ea2f68da0
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-27 15:34:24 +01:00
Ludovic Orban b77a8054a2 #9900 backport Accurate implementation of H3 Request.beginNanoTime()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-27 15:31:25 +01:00
Ludovic Orban 65c8b58843 #9900 backport Accurate implementation of H2 Request.beginNanoTime()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-27 15:30:56 +01:00
Olivier Lamy 358c8a7e29
upgrade those versions as Intellij fail because of this (#10924)
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-11-27 19:19:39 +10:00
Greg Wilkins 7dcab84b91
Fix jetty 12.0.x transient timeouts (#10844)
Fixes #10234

* Introduced transient failures in reads where a failure chunk has last=false.
* Transient failure now do not fail the handler callback.
* Improve eeN ContentProducer to more carefully assert transient and terminal errors + enable HttpInputIntegrationTest
* Do not add connection: close to the response when the error is transient
* Rework ChunksContentSource to support null chunks
* Added tests to verify the new transient failure cases
* Review all code that handles failure, and handling correctly transient failure, either by making them fatal, and/or by failing Content.Source.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Chad Wilson <chadw@thoughtworks.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-23 15:25:03 +01:00
Ludovic Orban b9bd3f2e83
Accurate implementation of H3 `Request.beginNanoTime()` (#10911)
#9900: Accurate implementation of H3 Request.beginNanoTime()

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-23 14:34:19 +01:00
Ludovic Orban 382638b84d #9900: simplify and add test
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-23 14:33:48 +01:00
Ludovic Orban 52e182486d #9900: remove unneeded changes
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-23 14:33:48 +01:00
Ludovic Orban b270724ff5 #9900: cleanup h2c nanotime code
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-23 14:33:48 +01:00
Ludovic Orban 0ebea03577 #9900: only take begin nanotime once per stream
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-23 14:33:48 +01:00
Ludovic Orban 03f2e76da5 #9900: Accurate implementation of H2C Request.beginNanoTime()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-23 14:33:48 +01:00
Lachlan 4a91cb7464
Merge pull request #10902 from jetty/jetty-12.0.x-addContainerResource
do not add duplicate jars to MetaData containerResources
2023-11-23 08:36:12 +11:00
Ludovic Orban f61fa04cef
Fix flaky `BlockingTest` (#10878)
* Make timed waits more reliable
* Remove all timed assertions to make this test non-flaky
* Synchronize the threads on their state to make sure blocking happens + add timeout annotation
* Use assertThrows where exceptions are expected

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-21 17:08:25 +01:00
Ludovic Orban 59a7bc1575 fix flaky testTcpCloseNoDemand test
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-21 09:58:29 +01:00
Lachlan 3d03339d43
Issue #10749 - WebSocketClient should expose upgrade request/response (#10761)
* Allow UpgradeListener to see Response in case of non-successful upgrade
* Using a boolean to track whether request was upgraded
* Improved exception handling in HttpUpgraderOverHTTP.
* Avoid using log warnings in CoreClientUpgradeRequest.
* Delayed setting of this.upgraded after the last throw statement.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-20 21:58:38 +01:00
Lachlan b8ece59544
WebSocketUpgradeHandler should not require ContextHandler (#10768)
* WebSocketUpgradeHandler should not require a ContextHandler
* Exposing the ServerWebSocketContainer as attribute also when creating the WebSocketUpgradeHandler with only the Server, to allow dynamic configuration of WebSocket endpoints.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-20 19:30:19 +01:00
Lachlan ecb90e8d0f
Issue #10687 - WebSocket remembers mappings on restart (#10773)
* Clear websocket mappings on server stop
* Fix core WebSocketUpgradeHandler on restart
* Avoid usage of deprecated WebSocketUpgradeHandler.configure() method.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-20 17:09:56 +01:00
Simone Bordet da2c601cd7
Fixed flaky test.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-20 09:02:34 +01:00
Lachlan Roberts 9a9d8fb6ea throw IllegalArgumentException if container resource is not readable
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-11-20 10:09:26 +11:00
Simone Bordet e933116997
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-19 22:09:10 +01:00
Simone Bordet b5af73e086
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-19 17:41:10 +01:00
Simone Bordet f82844e2a2 Fixes #10891 - Support the "Partitioned" cookie attribute.
Added support in oej.http.HttpCookie.
Bridged support for Servlet cookies via the cookie Comment attribute.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-19 17:37:18 +01:00
Olivier Lamy d84a74b3af
Merge branch 'jetty-10.0.x' into jetty-11.0.x 2023-11-18 10:51:55 +10:00
Olivier Lamy af13a72978
use correct scm coordinates (#10876)
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-11-18 01:49:30 +01:00
Simone Bordet d69dfc8d23
Fixes #10879 - Improve redirect handling with reproducible content (#10880)
* Fixes #10879 - Improve redirect handling with reproducible content

Now both the redirect and the authentication ProtocolHandlers will abort the request on response success.
If the request is already completed, the abort attempt will be a no-op, proceeding as usual.
Otherwise, the request upload will be aborted and a new request sent with the reproducible content.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2023-11-17 11:53:36 +01:00
Lachlan Roberts 4b0f45f121 warn on duplicate container resource for ee9
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-11-17 16:11:10 +11:00
Lachlan Roberts e7bac208b3 warn on duplicate container resource
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-11-17 16:10:18 +11:00
Lachlan Roberts 96657eb0a7 do not add duplicate jars to MetaData containerResources
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-11-17 13:16:46 +11:00
Olivier Lamy 11c510af1b
no need to annotate PRs with analysis results (#10901)
* no need to annotate PRs

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-11-16 08:10:16 -06:00
Joakim Erdfelt 3d8e3a1e40
Revert "Fix dependabot.yml"
This reverts commit 45750f84c3.
2023-11-15 13:29:30 -06:00
Joakim Erdfelt 45750f84c3
Fix dependabot.yml 2023-11-15 13:27:16 -06:00
Joakim Erdfelt 328b4a980e
Merge pull request #10896 from jetty/jetty-12.0.x-disable-duplicate-for-javadoc
disable duplicate finder for javadoc as it is plenty of unzipped sources
2023-11-15 07:41:08 -06:00
Joakim Erdfelt 2b3d811ea9
Don't track mounts for `newResource()` that doesn't exist (#10886)
* Don't track mounts for newResource() that doesn't exist.
* Cannot dereference if not tracking both resources that use the JAR.
* Only mount the root.  Check if root already mounted in mountIfNeeded

---------

Co-authored-by: gregw <gregw@webtide.com>
2023-11-15 07:26:29 -06:00
Ludovic Orban b436c85a63 Disable running SPNEGO test in parallel as its SimpleKdcServer server binds a static port
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-15 11:18:02 +01:00
Ludovic Orban 12e6af1ba3 add the event to the assertion list before writing the response
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-15 11:17:31 +01:00
Olivier Lamy ab4d01261a
disable duplicate finder for javadoc as it is plenty of unzipped sources
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-11-15 16:04:36 +10:00
Jan Bartel 9bf6229e01
Fix leaked resources in jetty maven plugin (#10888) 2023-11-14 23:52:18 +01:00
Greg Wilkins 4dd8bc9ca3
reinstate HttpChannel reuse in H2 (#10868)
Reinstated HttpChannel reuse in H2.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-14 17:16:12 +01:00
Greg Wilkins 49b344242b
Various cleanups of Handler.insertHandler (#10792)
* Various cleanups of Handler.insertHandler
* Added missing call to relinkHandlers() in setHandler() after calling super.
* Moved call to relinkHandlers() in insertHandler(), as the various setSession|Security|ServletHandler() already call relinkHandlers().

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

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-13 23:13:51 +11:00
Greg Wilkins 2c35f5a17a
Immutable local/remote SocketAddress within a ConnectionMetaData (#10867)
The local/remote SocketAddress is cached within the ConnectionMetaData or Connection instance, so that any changes are not visible during the request lifetime.
Ensure that all server Connection types respect HttpConfiguration#getLocalAddress and that it is not implemented only in servlet layer
Avoid DNS resolution.

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-11-13 23:05:20 +11:00