Commit Graph

1276 Commits

Author SHA1 Message Date
Lachlan 929eec9506
Merge pull request #10658 from jetty/fix/jetty-12.0.x-10333-requestTimeStamp
Issue #10333 - fix flaky test testLogRequestTimeCustomFormats
2023-10-18 15:47:20 +11:00
Lachlan Roberts 8f6a371195 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-websocketParameterMap 2023-10-18 07:39:51 +11:00
Joakim Erdfelt 74d301e49d
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-10-17 08:14:08 -05:00
Ludovic Orban 7e2c9e5e2f
Reintroduce dispatched and errors stats as well as stats-on time (#10678)
* #10555 reintroduced dispatched and errors stats as well as stats-on time counter

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-17 14:20:08 +02:00
Ludovic Orban 5a21bd328a
Fix NPE in ResponseListeners (#10730)
* #10726 fix NPE in ResponseListeners when demultiplexing is used and the original source spuriously calls demand()

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-17 14:19:10 +02:00
Ludovic Orban 674a1acf06
Allow POSTing with a URL not ending with '/' to jax-ws endpoints (#10710)
* #10699 allow POSTing with a URL not ending with '/' to jax-ws endpoints

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-17 14:18:29 +02:00
Ludovic Orban 4ed22a7a71
Fix race condition in `ArrayByteBufferPool.clear()` (#10704)
* #10703 fix race condition in clear() and make sure non-reusable released entries are removed from the pool

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-17 14:17:32 +02:00
Olivier Lamy f2ab447c4f
Merge 11 to 12 Issue #10731 wrong context attribute name javax.servlet instead of jakarta.servlet (#10735) and Address build/test failure against bad entities. (#10742) (#10745)
* Issue #10731 wrong context attribute name javax.servlet instead of jakarta.servlet (#10735)

* Issue #10731 wrong context attribute name javax.servlet instead of jakarta.servlet

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

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

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>

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

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>

* fix javadoc

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

* more usage of constant

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

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>

* Address build/test failure against bad entities. (#10742)

Bad entities in test case can lead to:

* external URL references
* required HTTP GET requests
* not testing redirectEntity / resolveEntity
  (the whole point of the test)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* use constant

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

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-10-17 07:29:13 +02:00
Greg Wilkins ffe80cd1f2
MutableHttpFields.asImmutable avoids copy (#10651)
* Avoid a copy in MutableHttpFields.asImmutable if the mutable is never mutated again.
* reduce instance creations needed for iterations
---------
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-10-17 08:58:19 +11:00
Lachlan Roberts 0fa3165018 revert changes to request
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-10-17 07:31:03 +11:00
Lachlan Roberts a8bf3ff99d Merge remote-tracking branch 'origin/jetty-12.0.x' into fix/jetty-12.0.x-10333-requestTimeStamp 2023-10-17 07:29:36 +11:00
Lachlan Roberts 791d9e9783 make CustomRequestLogTest.testLogRequestTimeCustomFormats more lenient
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-10-17 07:29:26 +11:00
Simone Bordet 825fc6df1f
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-16 09:41:45 +02:00
Lachlan Roberts ee702b01c2 Issue #10734 - fix websocket CoreSession getParameterMap
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-10-16 12:18:37 +11:00
Simone Bordet e45814a49a
Javadocs.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-13 16:56:36 +02:00
Ludovic Orban 937713fc73 #10698 fix racy assertion
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-13 11:39:21 +02:00
Simone Bordet 57dcf7c525
Added missing API getRequest().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-13 11:28:14 +02:00
Ludovic Orban d6c900a783
Fix flaky leaky h2 tests (#10728)
* Fixed more tests that became flaky after #10554.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-13 11:09:30 +02:00
Olivier Lamy fcc88274a4
Jetty 12.0.x use automatic formatter for poms to have same style for every poms (#10578)
* apply spotless sort pom

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-10-12 03:51:36 +02:00
Ludovic Orban 9275d2acca Made tests relying on TestForbiddenMethodsEventsHandler not flaky
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-10 17:09:56 +02:00
Joakim Erdfelt 6b3f760b80
Updating to version 12.0.3-SNAPSHOT 2023-10-09 21:16:46 -05:00
Joakim Erdfelt b01e3611cf
Updating to version 12.0.2 2023-10-09 20:59:14 -05:00
Lachlan Roberts 70b1fd40ef fix infinite recursion in server dump with Path
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-10-10 11:26:55 +11:00
Simone Bordet 7bd6c5211d
Fixes #10679 - Review HTTP/2 rate control. (#10682)
* Bumped the rate control rate from 50 events/s to 128.
* Added rate control for all CONTINUATION frames.
* Added rate control for invalid PUSH_PROMISE frames.
* Added rate control for RST_STREAM frames.
* Added rate control for all SETTINGS frames.
* Fixed growth of header block accumulation buffer.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-09 15:19:00 +02:00
Simone Bordet c41509950b
Fixes #10657 - jetty-http-tools-12.0.1.jar is not well-formed
Added Maven property <bundle-symbolic-name>.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-07 15:14:23 +02:00
Simone Bordet 3608ecf999
Changed default implementation of Session.Listener.onNewStream() and … (#10672)
* Changed default implementation of Session.Listener.onNewStream() and Stream.Listener.onDataAvailable() to auto-discard DATA frames.
For normal cases, these methods are overridden and the application is in full control.
For test cases, these methods may not be overridden and the default implementation conveniently avoids buffer leaks.

Fixed flaky test RawHTTP2ProxyTest.testRawHTTP2Proxy() due to the bad assumption that the first DATA frame ends the stream (so an aggregator is needed), and a copy/paste error in ServerToProxyToClient while processing DATA frames.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-06 14:18:09 +02:00
Simone Bordet ff57574285
Fixed test `FlowControlStrategyTest` after the changes of #10554.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-05 20:08:53 +02:00
Simone Bordet a4b55e6964
Fixed flaky test `StreamResetTest.testResetAfterBlockingWrite()`, that became flaky after #10554.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-05 19:47:28 +02:00
Simone Bordet d8338124ee
Fixed flaky test `GoAwayTest.testServerGoAwayWithStalledStreamServerConsumesDataOfInFlightStream()`, that became flaky after #10554.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-05 18:47:38 +02:00
Ludovic Orban fb3c2a0ebe Disable more flaky tests failing because of buffer leaks
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-10-05 14:44:53 +02:00
Simone Bordet 53de4c8298
Fixes #10611 - Flaky StreamResetTest.testClientResetConsumesQueuedData() (#10655)
Fixed test case that was racy.
When the DATA frames arrived at the server before the call to consumeAvailable(), they were read and the client flow control window re-opened.
If it happened that the DATA frames arrived at the server after the call to consumeAvailable(), the client flow control window was not re-opened, making the test flaky.
Fixed by avoiding the race in the test.

Added over-release buffer tracking, add leak tracking to H2 tests, fix client leaks in tests.

Also reviewed the places that required re-opening of the flow control window in case the DATA frames are not read.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-10-04 14:47:26 +02:00
Lachlan Roberts a56faad195 Issue #10333 - save the value of Request.getTimeStamp so it returns consistent value.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-10-04 09:42:37 +11:00
Greg Wilkins 8331809c40
Fix getCharacterEncoding issue with #10563 (#10650)
Do not persist a defaulted charset used in the request.
Throw `UnsupportedEncodingException` from `getReader`
2023-10-03 12:45:40 +11:00
Simone Bordet 27865d29b4
Fixed NPE introduced by #10618.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-02 15:53:40 +02:00
Simone Bordet 0981c22c33
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-01 22:48:58 +02:00
Ludovic Orban 5b1c0b8704
Reduced mildly expensive HttpMethod.is calls by reordering boolean logic (#10618)
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-29 17:51:10 +02:00
Greg Wilkins 9ce414125d
Fix incorrect call to super in BufferedResponseHandler (#10613)
Also cleaned up needless super call in Server
2023-09-28 16:16:44 +02:00
Lachlan aa880cff09
Issue #10513 - fix multipart lockup with HTTP/2 (#10554)
* Changes the H2 semantic of `Stream.readData()` so that it is `readData()` that enlarges the flow control window, and not anymore the release of the `Stream.Data`.
This allows applications to buffer in memory by retaining the `Stream.Data` instances more than the H2 flow control window.
* Updated `FlowControlStrategyTest` after `Stream.readData()` semantic changes.
* Updated `DataDemandTest` after `Stream.readData()` semantic changes.
* Updated documentation.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-09-28 11:47:32 +02:00
Simone Bordet 5be34089ef
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-28 11:41:34 +02:00
Ludovic Orban ffb00fd7f1 #10543 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban 56eadabbfb #10543 align buffer releasing in all streams' consumeAvailable() implementations
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban 70d333f376 #10543 align buffer releasing in all streams' consumeAvailable() implementations
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban 5ffbf523d7 #10543 use var instead of fully qualified class name
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban aab665d7e1 #10543 make sure HttpConnection always releases its retainable buffer when needed
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban e290ff9561 #10543 re-instate H3 fix as temporary
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban d03fc25b9c #10543 release buffer when fill returns -1
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban b9f1fb3187 #10543 make sure drainClearBytesForStream() returns -1 instead of throwing when the stream is finished to avoid a stack overflow
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban 5c9d796a49 #10543 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban b25dc8183b #10543 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Ludovic Orban 1286f91b1c #10543 record failure as chunk to avoid consumeAvailable to stack overflow
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-27 16:44:35 +02:00
Lachlan Roberts 46b1959c9d fixes for merge from 11 to 12
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-09-27 10:13:48 +10:00
Lachlan Roberts 69360b80fd Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-09-27 10:00:08 +10:00
Greg Wilkins 1a207dbeea
An omnibus PR for changes needed to support webfunctions (#10563)
Web functions are currently supported with servlets. These changes add/move utility classes to core to better support direct usage of core APIs
 * increase usage of Charset in request
 * Added flush mechanism to BufferedContentSink
2023-09-27 09:29:15 +10:00
Ludovic Orban d2dff9a758
Fixes #10483 - Improve BufferedResponseHandler
* Changed default buffer size from 2 GB to 16 KB.
* Make max buffer size configurable.
* Introduce `BufferedContentSink` with all the buffering logic, doing only one buffer copy instead of two, starting with a small buffer and growing it if needed.
* Refactor `BufferedResponseHandler` to delegate all buffering work to `BufferedContentSink`
* Introduced `ByteBufferAggregator` to aggregate ByteBuffers into a single ByteBuffer.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: gregw <gregw@webtide.com>
2023-09-26 10:13:35 +02:00
Simone Bordet 5dc6062376
Fixes #10482 - RewriteHandler with multiple HeaderPatternRules. (#10572)
Reviewed the implementation of RewriteHandler, that was broken for those rules that were overriding `Rule.Handler.handle()`.

The problem was that the handling was not forwarded along the chain of rules, so only the last one was applied.

Now the wrapping at the constructor produces RH3(RH2(RH1(Request))), but the handling is performed from the innermost towards the outermost.
In this way, the order of rules is respected, both in the wrapping at rule application, and in the `Rule.Handler` handling.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-26 08:01:34 +02:00
Ludovic Orban 45359a063f
disable leak tracking on tests that fail flakily because of leaks (#10566)
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-26 01:55:50 +02:00
Olivier Lamy b945ca6e40
Issue #10421 fix jpms warning (#10424)
* remove wrong jpms declaration

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

* remove non valid jpms sections from mod files

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

* more cleanup

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

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-09-26 09:33:41 +10:00
Ludovic Orban 344c501940 Merge remote-tracking branch 'origin/jetty-11.0.x' into fix/merge-from-11 2023-09-25 17:40:39 +02:00
Jan Bartel 0e79cc8cb3
Issue #10466 review session documentation. (#10497)
* Issue #10466 review session documentation.

Also fix session config context init param names and add missing code to
configure SessionHandler via context init params, and added test for
config.
2023-09-22 08:18:29 +02:00
Greg Wilkins 57b953be67
Reintroduce an Exception type for invalid UTF-8 (#10553)
Introduce `Utf8CharacterCodingException`  and `Utf8IllegalArgumentException` as a substitutes for the removed `Utf8Appendable.NotUtf8Exception`.

* Updates from review
2023-09-22 12:24:42 +10:00
Greg Wilkins f9ca02c393
ConditionalHandler (#10492)
Added a Conditional Handler

Co-authored-by: Jan Bartel <janb@webtide.com>
2023-09-22 09:25:24 +10:00
Lachlan 42468ae1bd
Merge pull request #10494 from eclipse/jetty-12.0.x-10490-websocketServerUpgradeRequest
Issue #10490 - fixes and testing for websocket JakartaServerUpgradeRequest
2023-09-21 11:46:28 +10:00
Joakim Erdfelt aefa331aa4
Issue #10328 - Review ResourceFactory.newSystemResource (#10533)
* Issue #10328 - Review ResourceFactory.newSystemResource

+ Create a new ResourceFactory.newClassLoaderResource(String, boolean)
+ Make .newSystemResource(String) use it
+ Make .newClassPathResource(String) use it
+ Deprecate .newSystemResource(String)
+ Deprecate .newClassPathResource(String)
+ Adjust own codebase to not use deprecated methods
2023-09-20 16:43:22 -05:00
Lachlan Roberts 665cae2ec2 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-10490-websocketServerUpgradeRequest 2023-09-21 07:24:08 +10:00
Simone Bordet d1a1663b39
Fixes #10324 - Improve migration from Servlets to Handler. (#10529)
* Using request.getLength() instead of looking up the Content-Length header.
* Jetty Handler vs Servlet pros.
* Using CompletableFuture (not Promise) in examples.
* Removed unused cruft from tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-20 21:15:20 +02:00
Ludovic Orban e68fd6c16c #10539 fix npe when timeout races with failed completion
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-20 09:37:18 +02:00
Ludovic Orban 5025d7c66c #10382 fix npe when timeout races with successful completion
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-20 09:37:18 +02:00
Ludovic Orban acf59132fd #10382 fix npe when timeout races with normal completion
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-20 09:37:18 +02:00
Greg Wilkins 4ae70db8e3
fixed #10513 ContentSourceInputStream close with available (#10525)
Address #10513 ContentSourceInputStream close by making it do a single read looking for EOF
If any content is skipped, then it is an abnormal close.
use Chunk.next in read
2023-09-19 21:25:41 +10:00
Simone Bordet 32227570e5
Fixed deadlock in class initialization. (#10540)
* Thread T1 may initialize HttpTester.Message that extends MutableHttpFields, so grabs the lock for the initialization of class MutableHttpFields.
* Thread T2 may initialize HttpFields, so grabs the lock for HttpFields and initializes field EMPTY, which calls new MutableHttpFields.
* To initialize MutableHttpFields, T1 must initialize HttpFields, but sees that its lock is taken and waits.
* To initialize HttpFields, T2 must create an instance and therefore initialize MutableHttpFields, but sees that its lock is taken and waits.
* Deadlock.

The solution is to use another class, EmptyHttpFields, to initialize HttpFields.EMPTY, so that there is no deadlock.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-18 17:37:03 +10:00
Greg Wilkins 09710c7cb6
Fix jetty 12 javadoc (#10527)
Fixes for javadoc warnings
2023-09-18 17:30:02 +10:00
Greg Wilkins 4e27d308df
Fix parsing of JSESSIONID only (#10479)
Improved parsing of JSESSIONID cookies and jsessionid parameters.
Better handling of invalid and duplicate session IDs

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
2023-09-18 17:27:28 +10:00
gregw fb80522675 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-09-18 17:25:11 +10:00
Joakim Erdfelt dfd82a01d4
Issue #10500 - preserve request header quoting when accessed through `JettyHttpExchangeDelegate` (#10503)
* Issue #10500 - preserve request header quoting when accessed through JettyHttpExchangeDelegate
* improve test cases with quoted-pair feature in RFC
* add skip of value lists on specific headers known to not have value lists
* Remove URL usage
* Changes from review
2023-09-15 16:54:09 -05:00
Simone Bordet f47cc15724
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-15 09:27:48 +02:00
Jan Bartel 26fdbe3280
Issue #10474 support application/json for ErrorHandler (#10504) 2023-09-15 03:12:48 +02:00
Simone Bordet 08190e1a50
Fixes #9665 - HttpCookieStore incorrectly rejects cookies for domains that are an IPv6 address (#10465)
* Refactored domain checks into overridable method.
* Added support for IPv6, and clarified domain checks.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-14 19:27:18 +02:00
Simone Bordet 530ed33611
Fixes #10219 - Review HTTP Cookie parsing (#10464)
* Added SetCookieParser interface and RFC6265SetCookieParser implementation to properly parse Set-Cookie values.
* Removed hacky implementation in HttpClient.
* Removed unused methods in HttpCookieUtils.
* Using SetCookieParser for the implementation of newPushBuilder in ee9,ee10.
* Reworked HttpCookieStore.Default implementation.
* Implemented properly cookie path resolution.
* Using URI.getRawPath() to resolve cookie paths.
* Removed secure vs. non-secure scheme distinction when storing cookies.
* Refactored common code in HttpCookieStore.Default to avoid duplications.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-14 17:13:05 +02:00
Simone Bordet 388d3e38fa
Fixes #10361 - Introduce QoSHandler (#10480)
* Introduced QoSHandler.
* Updated documentation, and removed old documentation.
* Now using dynamic max priority.
The current implementation retains priorities and queue as they are created, but hopefully the priority range is constrained.
* Better algorithm for resuming: rather than releasing a permit and try to acquire it again, keep the permit and resume a request.
This also removes the issue that a request could have been suspended again, therefore remaining suspended much more than maxSuspend.
* Deprecated QoSFilters in ee10 and ee9.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-14 15:46:12 +02:00
Simone Bordet 8684b0a67a
Introduced CompletableResponseListener (#10502)
Introduced CompletableResponseListener, a replacement for FutureResponseListener that uses better APIs based on CompletableFuture.

Deprecated FutureResponseListener and replaced its usages.

Updated documentation.

Added tests for zipped request content.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-14 15:33:51 +02:00
Lachlan Roberts 4bdd21f777 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-10490-websocketServerUpgradeRequest 2023-09-14 09:57:50 +10:00
Simone Bordet 85c72720fc
Fixes #10442 - Reduce verbosity when JMX finds overloaded setter (#10443)
Now the log statement is only emitted when there is no matching setter method, but a mismatched one exists.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-09-13 15:17:22 +02:00
Jan Bartel 4bbfa3949b
Issue #10440 fix ClassCastException for <jettyEnvXml> in maven plugin (#10493)
* Issue #10440 fix ClassCastException for <jettyEnvXml> in maven plugin

* disable H1 client leak tracking for testInputStreamContentProviderThrowingWhileReading

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

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-09-12 07:49:45 +02:00
Ludovic Orban 022c99cd24 #10226 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-11 11:47:04 +02:00
Ludovic Orban cb68dc92c3 #10226 fix buffer leak in consumeAvailable() when HttpStream.consumeAvailable() leaves unconsumed content
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-11 11:47:04 +02:00
Ludovic Orban 8b3db91174 #10226 only release the buffer when it could not be propagated to a Content.Source reader
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-11 11:47:04 +02:00
Ludovic Orban 499816f79c #10226 fix HTTP consumeAvailable() buffer leak and re-enable tests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-09-11 11:47:04 +02:00
Lachlan Roberts 3066737016 Issue #10490 - fixes and testing for websocket JakartaServerUpgradeRequest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-09-11 17:00:02 +10:00
Joakim Erdfelt a415da73df
Merge remote-tracking branch 'origin/jetty-11.0.x' into fix/12.0.x/merge-from-11 2023-08-31 16:06:14 -05:00
Joakim Erdfelt 1d226403da
Updating to version 12.0.2-SNAPSHOT 2023-08-29 16:55:36 -05:00
Joakim Erdfelt 4768745849
Updating to version 12.0.1 2023-08-29 16:38:20 -05:00
Simone Bordet c638753b8d Fixes #10293 - Improve documentation on how to write a response body in Jetty 12.
Updated documentation about:
* Content.Source
* Content.Sink
* Handler
* Request/Response

Updated few APIs to make easier to write applications.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-29 22:07:42 +02:00
Greg Wilkins d3cd69be68
Fix #10411 default environment (#10415)
Implemented a simpler default environment algorithm where an application that does not specify an environment is always attempted in the default.

Updated documentation.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-29 18:34:21 +02:00
Ludovic Orban 67ecd9f4a3 #9900 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 17:11:07 +02:00
Ludovic Orban 4757333ed5 #9900 accurate implementation of Request.getBeginNanoTime() for FCGI
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 17:11:07 +02:00
Greg Wilkins d6a0226866
Fix #9169 refine idle timeout and failure (#10418)
Only fail request callback if a failure has not been otherwise notified.
Slight optimisation for failing idle timeouts by avoiding double lock.
Always create a failure if failing the callback.
2023-08-29 20:44:40 +10:00
Ludovic Orban 155137605a #10226 disable client leak tracking for H1 transports
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 8ae62e3a95 #10226 disable client leak tracking for all transports
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban f3a21cec6f #10226 fix heap dump
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 159238471b #10226 handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban a4e33a019f #10226 disable leak tracking only for client/server or impacted transports
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 18797fad57 #10226 add ability to disable leak tracking and disable currently known leaky threads
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 44aa6036b3 #10226 assert using awaitility and fix heap dump cleanup when a leak is detected
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 01f8812dbb #10226 improve testDownloadWithCloseMiddleOfContent debuggability by helping to discriminate the buffers by their content
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban eece4b0fde #10226 dump the heap when a buffer leak is detected
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 83ee6387b8 #10226 improve Tracking.Buffer dump
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 174c59e9a1 #10226 assert using awaitility
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban bbb994f96d #10226 improve ArrayByteBufferPool.Tracking
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 2fcccef0c4 #10226 fix GZIPContentDecoder buffer leak of zero-capacity buffers
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Ludovic Orban 7083fa3927 #10226 restore leak tracking in tests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-29 09:58:39 +02:00
Greg Wilkins e3ee84a5ad
Fix #10416 Do not copy ee9 response headers (#10417)
Use the core response HttpFields directly as the ee9 response headers to avoid copy and retain persistent field behaviour.
Fix #10416 EE9 Response headers
Added EE9 test to show that Persistent fields can be modified
Updated fix for #10339 so that persistent fields revert to original values after a clear operation
2023-08-29 08:31:02 +10:00
Simone Bordet 5a8c5bc8c7
Fixes #10353 - Questions about porting WebSocket APIs to jetty-core 12 (#10354)
* Added direct WebSocket upgrade in the Jetty core WebSocket APIs.
* Updated the WebSocket documentation.
* Optimized WebSocketMappings.getMatchedNegotiator() to avoid allocating a lambda for every invocation.
* Cleaned up core.server.WebSocketUpgradeHandler.
* Expanded websocket docs to mention how the demand mechanism works.
* Fixed code examples with correct demand handling.
* Javadocs for api.Callback.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-28 17:46:12 +02:00
Simone Bordet 2bf25969a0 Improved Handler javadocs.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-26 12:32:47 +02:00
Greg Wilkins 8ed56b3466
Implement containsLast in HttpFields (#10340)
Fully implement list iterator so that we can efficiently check for the last item in a multi header list.

---------

Signed-off-by: gregw <gregw@webtide.com>
2023-08-26 10:05:29 +10:00
Simone Bordet eeee3ca8ac
Added well-known HTTP/3 servers.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-25 15:33:46 +02:00
Lachlan be11dfdbab
Merge PR #10400 to 12.0.x for InetAccessHandler (#10403)
Issue #10388 - fix InetAccessHandler module

Add DistributionTest for InetAccessHandler
Removed deprecated method from InetAccessHandler.
Fixed InetAccessHandler DistributionTests for 12.

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-08-25 11:32:46 +02:00
Lachlan Roberts 67404f96ce use HttpStatus for 413 and 500 codes in SizeLimitHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-25 16:24:31 +10:00
Lachlan Roberts be83eb94ad Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-FixSizeLimitHandler 2023-08-25 16:21:45 +10:00
Lachlan 5c7a222697
Merge pull request #10313 from eclipse/jetty-12.0.x-10295-formAuthDispatch
Issue #10295 - implement EE10 FormAuthenticator with dispatch option
2023-08-25 16:14:40 +10:00
gregw 93d31193fa Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
# Conflicts:
#	jetty-core/jetty-util/src/test/java/org/eclipse/jetty/util/CharsetStringBuilderTest.java
2023-08-25 14:55:30 +10:00
Greg Wilkins 4086c7ee47
Persistent HttpFields (#10339)
Use a marked field rather than freeze/thaw, to support fields that cannot be removed.
2023-08-25 13:02:32 +10:00
Simone Bordet 4c32dfc4d8
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 18:56:21 +02:00
Simone Bordet a12eccdd93
Larger timeout for testTrailers().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 18:13:42 +02:00
Simone Bordet 50dfb003af
Smaller write for testTrailers() is enough.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 18:01:43 +02:00
Simone Bordet c977ea1de9
Make sure the tests specify a request total timeout to avoid infinite waits.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-24 17:50:56 +02:00
Lachlan Roberts 4bd3a8e431 Revert "Issue #10337 - fixes for SizeLimitHandler"
This reverts commit 2126ac262c.
2023-08-24 15:05:43 +10:00
Simone Bordet 9d908839cf Fixes #10338 - ErorrHandler#writeErrorJson is private
Made the writeErrorXYZ() methods protected in ErrorHandler for core, ee9 and ee10.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-23 18:03:13 +02:00
Simone Bordet 7f1d262aee
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-23 15:47:15 +02:00
Lachlan Roberts 3b1e07ef99 make AuthenticationState.ServeAs as class instead of interface
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-23 17:10:39 +10:00
Lachlan Roberts 5a28d48b93 Move ServeAs code to Request, so it can be used elsewhere
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-23 12:32:46 +10:00
Lachlan Roberts 7e875d1411 make the ServeAs.PathWrapper take HttpURI instead of String
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-23 11:23:19 +10:00
Ludovic Orban 1fff9787bd #10226 - handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-22 10:17:33 +02:00
Ludovic Orban 5b93435358 #10330 - handle review comments
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-22 10:17:33 +02:00
Ludovic Orban 57823bef6e #10330 - add extra ResourceHandler range tests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-22 10:17:33 +02:00
Ludovic Orban dd6a971f27 #10330 - Fix broken EE10 DefaultServlet range requests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-08-22 10:17:33 +02:00
Lachlan Roberts f0953e4d29 add javadoc and rename AuthenticationState.ServeAs.PathWrapper
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-22 15:02:37 +10:00
Lachlan Roberts 2126ac262c Issue #10337 - fixes for SizeLimitHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-22 10:49:24 +10:00
Olivier Lamy 97e1527ed6
Jetty 12.0.x use Maven build cache for PRs and branches except jetty-12.0.x main branch (#9871)
* apply configuration/changes for build cache

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

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-08-22 02:46:46 +02:00
Joakim Erdfelt 2178dc2913
Issue #10309 - Duplicate `X-Powered-By` headers (#10310)
* Make HttpChannelState responsible for X-Powered-By / Server headers
* Remove X-Powered-By handling in HttpGenerator
2023-08-21 17:00:21 -05:00
Simone Bordet 486ec677cf
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-21 10:43:49 +02:00
Greg Wilkins c74437f9a8
Improve contextpath javadoc (#10297)
Fix #10294 Improve getContextPath javadoc
2023-08-21 08:07:46 +10:00
Simone Bordet 660ba4bbe5
Fixes #10284 - Document all HttpFields methods (#10308)
* Added javadocs where missing and updated existing in both HttpFields and HttpField.
* Removed HttpFields.takeAsImmutable() because it had a confusing semantic.
* Deprecated HttpFields.[Mutable|Immutable]HttpFields and moved their implementation to top level package private classes.
* Deprecated HttpField.valueParameters(), as there is an identical getValueParameters()
* Fixed inconsistencies of HttpField.value, where in most cases could not be null, but in one case was allowed; now it can never be null.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-18 10:19:36 +02:00
gregw 13cf2dade7 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/HttpParser.java
#	jetty-core/jetty-http/src/test/java/org/eclipse/jetty/http/HttpParserTest.java
2023-08-18 17:38:44 +10:00
Lachlan Roberts e6942da18e Issue #10337 - fixes for SizeLimitHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-18 17:08:13 +10:00
Lachlan Roberts a8832c4fa9 fixes for BasicAuthenticatorTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-18 14:57:15 +10:00
Lachlan Roberts 9f6da9a11e add some javadoc and cleanup to Request.get
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-18 12:42:03 +10:00
Lachlan Roberts f9f42d5303 add testing for core FormAuthenticator dispatch
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-18 12:27:28 +10:00
Lachlan Roberts 6e5ea8196f cleanups and changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-18 11:55:36 +10:00
Lachlan Roberts a418e0db71 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-10295-formAuthDispatch 2023-08-18 11:43:31 +10:00
Jan Bartel 33ef0b040a
Issue #10158 Change ignored deployment message to WARN (#10321) 2023-08-18 03:18:29 +02:00