Commit Graph

1209 Commits

Author SHA1 Message Date
Simone Bordet d3e40d86e8
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-02 23:05:45 +02:00
Joakim Erdfelt fc37681cbb
Ensure @BeforeEach and @AfterEach are public methods (not protected) 2023-07-31 16:40:21 -05:00
Joakim Erdfelt f15e4a152f
Merge pull request #10179 from eclipse/fix/12.0.x/junit-test-syntax
Fix Junit usage issues
2023-07-31 16:33:34 -05:00
Joakim Erdfelt 4fe2b041c3
Merge pull request #10178 from eclipse/fix/12.0.x/spec-webapp-testing
Fix demo-spec webapp failures
2023-07-31 13:03:24 -05:00
Simone Bordet 8733746c66
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-31 19:31:57 +02:00
Simone Bordet a1d9f589b6
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-31 19:21:14 +02:00
Simone Bordet 5a3549f0d0
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-31 19:18:19 +02:00
Joakim Erdfelt b9c39b1105
Ensure @BeforeEach and @AfterEach are public 2023-07-31 11:53:15 -05:00
Joakim Erdfelt b6af685cd0
Ensure @Test methods are public 2023-07-31 11:42:33 -05:00
Joakim Erdfelt 4a2ebe00be
Issue #10164 - test to prove out FSPool mount vs reference count logic (#10170)
* Issue #10164 - test to prove out FSPool mount vs reference count logic
* Issue #10164 - improve ResourceFactory.LifeCycle.dump behavior
2023-07-31 11:11:34 -05:00
Joakim Erdfelt a157cf7cb8
Create IO.copyDir(Path, Path, CopyOptions...) and use it 2023-07-31 11:10:51 -05:00
Simone Bordet c90c42ffc6
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-31 17:54:50 +02:00
Lachlan bd7d504c28
Issue #10135 - fix empty binary frame from websocket flush (#10175)
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-07-31 15:21:12 +02:00
Simone Bordet 8149db2286
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-27 00:13:49 +02:00
Simone Bordet e7ab35e749
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-27 00:00:10 +02:00
Joakim Erdfelt ad5c2985d5
Issue #10134 - Delay Base Resource validation to `ContextHandler.doStart()` (#10147)
* Issue #10134 - Delay Base Resource validation to `ContextHandler.doStart`
2023-07-26 06:36:23 -05:00
Simone Bordet 040d340cdb
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-26 10:48:06 +02:00
Simone Bordet abc01d57fd Fixes #10120 - OOME due to HttpChannelState._onIdleTimeout
When `HttpChannelState._onIdleTimeout` was introduced, it was forgotten to null it out in recycle().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-18 22:04:53 +02:00
Simone Bordet c946a41871 Fixes #10123 - MultiPartByteRanges request gets stuck
The handling of reads in MultiPartByteRanges.PathContentSource was broken for ranges that were larger than the read buffer size.

Fixed by properly counting how many bytes are left to read.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-18 21:37:35 +02:00
Simone Bordet c19a5817f9
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-17 23:51:40 +02:00
Simone Bordet bd80b675ba
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-17 16:51:42 +02:00
Simone Bordet af90b35ee7
Moved class `Flags` from `http2.internal` back to `http2` to be used publicly.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-16 12:09:33 +02:00
Simone Bordet 69e2f10521
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-16 12:01:43 +02:00
Joakim Erdfelt 8e52abe8c9
Merge `jetty-11.0.x` into `jetty-12.0.x` - July 14 (#10108)
* Updating various old/moved URL references found across project (`jetty-10.0.x`) (#10098)

+ Now that the migration of `https://eclipse.org/jetty/` to `https://eclipse.dev/jetty/` has occurred, it is time to review the URI use in our project
+ Updated URLs in poms
+ Added more URIs to XmlConfiguration
+ Updated URLs in module files
+ Updated URLs in documentation
+ Updated URLs in HTML
+ Correcting bad double-scheme URLs (eg: `http://https://www.eclipse...`)
+ Updating text in *.mod files
+ Removing `/current/` from path `/jetty/documentation/current/`
+ Fixing mailing list URL
+ Fixing github URL references in jsps

---------

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-07-14 20:21:11 -05:00
Simone Bordet 9a476e2c0c
Small changes from #10090.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-14 18:09:35 +02:00
Simone Bordet 0879f6bc85
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-14 17:49:07 +02:00
Ludovic Orban 248354f64a
Fixes #9910 - Inconsistent handling of welcome files
* Added DefaultServlet combinations tests.
* Removed pathInfoOnly handling present in Jetty 11, because it is always true for mapping to "/", and always false for other mappings.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-07-14 11:58:21 +02:00
Lachlan 993a111805
Merge pull request #10071 from eclipse/jetty-12.0.x-sizeLimitHandler
add SizeLimitHandler to Jetty-12
2023-07-14 16:37:02 +10:00
Simone Bordet 190af2972b
Fixes delivery of events to `Response.CompleteListener`s. (#10102)
In case of `request.onComplete(Response.CompleteListener l)`, only the complete event should be delivered to `l`, not all the events (in case `l` implements other listener interfaces).

Only `Response.CompleteListener` passed to `request.send(Response.CompleteListener)` should receive all events.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-13 15:12:47 +02:00
Simone Bordet a08e953c74
Fixes #10087 - Flaky EventsHandlerTest due to trailers. (#10093)
* Fixes #10087 - Flaky EventsHandlerTest due to trailers.

HTTP/2 trailers may arrive and be processed before the application reads request chunks.

Avoid the race condition by storing the trailers aside and returning them during reads.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-13 08:19:03 +02:00
Greg Wilkins 0ee0716d33
Various cleanups of StringUtil and TypeUtil (#10082)
* Various cleanups of StringUtil and TypeUtil

Removed deprecated and unused methods
Moved charset handling to MimeTypes
resolve IDE warnings

* updates from review
2023-07-12 10:31:28 +02:00
Simone Bordet bd80297f7e
* Fixed resource leak in `App` when reading the web application properties file.
* Small updates to the deploy documentation.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-11 19:29:12 +02:00
Joakim Erdfelt c8fd1a198a
Issue #10084 - Directory results from `getResourcePaths(String)` should include trailing slash (#10085)
* Issue #10084 - Directory entries on return of getResourcePaths(String) should include trailing slash
* Issue #10084 - Fixing test case order of entries in collection expectation
* Issue #10084 - Implementing fix for ee9
* Issue #10084 - Fixing bug in ServletContext.getRealPath() impl
* Issue #10084 - Fixing tests in ee9 to make them compatible with ee8 conversion
* Bring Resource.getFileName in alignment with other JVM methods of the same name. (eg: Path.getFileName)
2023-07-11 11:39:23 -05:00
Simone Bordet 0bab243389
Improved javadocs of Response.setTrailersSupplier().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-10 19:43:43 +02:00
Simone Bordet 4f3b4a092d
Avoid NPE when calling `getTotalKeys()` before `ManagedSelector` is started.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-10 19:43:13 +02:00
Greg Wilkins 67f194a818
Improve javadoc of Violations for #9444 (#10079)
Improve javadoc of Violations for #9444
2023-07-10 10:03:06 +02:00
Joakim Erdfelt 97e39bcf58
Bump jimfs to 1.3.0 2023-07-07 12:26:26 -05:00
Lachlan Roberts 7cee1f54ba add SizeLimitHandler to Jetty-12
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-07-06 13:59:00 +10:00
Greg Wilkins 32dc0c804d
Simplified URLResource cleaner (#10061)
* Simplified URLResource cleaner

The reference to the InputStream does not need to be soft/weak as a hard reference to it does not prevent the URLResource itself from being collected.  Also by making a runnable record, there is one less allocation per input stream creation.

* Simplified URLResource cleaner

Use AtomicReference for the inputstream, so that if it is taken, then it is nulled and will not be closed.

* Simplified URLResource cleaner

Improved tests
2023-07-05 19:00:39 +02:00
Joakim Erdfelt dbe9a25508
Issue #9973 - use URIUtil.addPaths() instead of URI.resolve() (#10058)
* use URIUtil.addPaths() instead of URI.resolve()
* Better Connection / InputStream locks
* Removing URLResource.close()
* Adding URLResourceFactory.setReadTimeout()
* restore existence check in isDirectory
* Simplify URLResource.resolve

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-07-03 15:51:38 -05:00
Lachlan Roberts 69728c3773 fix test failure and cleanup jetty core client pom.xml
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-07-03 09:33:20 +10:00
gregw e0133d72bf Merge branch 'jetty-12.0.x' into jetty-12.0.x-9396-websocket-jpms-review 2023-06-30 17:17:16 +02:00
Greg Wilkins ec2dbe73a8
Fully async Multipart Form handling (#9975)
A fully async ContentSourceCompletableFuture for use by MultiPartFormData and MultiPartByteRanges
Restructure MultiPartFormData to have a Parser class
---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-30 17:01:16 +02:00
Ludovic Orban 457d41ccad
Add constructors accepting the handler to wrap to all core handler wrappers (#9988)
Add constructors accepting the handler to wrap to all core handler wrappers

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-30 13:15:45 +02:00
Lachlan 93a5726cbe
Merge pull request #9982 from eclipse/jetty-12.0.x-9965-fixDemandImplementation
prevent multiple demand in websocket-core
2023-06-30 12:55:17 +10:00
Joakim Erdfelt 55d0f9445b
Issue #9973 - Unwrap URI.scheme-specific-parts until we find a path we can resolve against. (#9995)
* Issue #9973 - Unwrap URI.scheme-specific-parts until we find a path we can resolve against.
2023-06-29 11:40:42 -05:00
Jan Bartel d3d298c5f3 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-06-29 15:01:19 +02:00
Ludovic Orban caf421e827 remove unnecessary FileBufferedResponseHandler
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-29 14:22:46 +02:00
Jan Bartel 5dee316da3 Merge remote-tracking branch 'jetty-11/jetty-11.0.x' into jetty-12.0.x 2023-06-29 12:55:35 +02:00
Lachlan Roberts 867fe46e75 fix DemandState in WebSocketConnection
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-06-29 20:31:43 +10:00
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