Commit Graph

1198 Commits

Author SHA1 Message Date
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
Greg Wilkins 042841a7c6
Fix #10306 getServerHost (#10311)
Fix #10306 getServerHost
2023-08-18 10:11:39 +10:00
Greg Wilkins 5aea1e44b7
Experiment/12/improve default servlet (#10222)
* Improve Jetty 12 DefaultServlet

 + don't wrap the httpServletRequest unless necessary due to wrapping
 + don't wrap the httpServletResponse unless necessary due to wrapping
 + send content asynchronously if large and unfiltered
 + Remove unused boolean return from ServletChannel.handle
 + added TODOs where range request handling could calculate content length
 + Call multipartlength, even though it is always -1
 + Use static for bytes written
2023-08-18 00:54:05 +10:00
Joakim Erdfelt 6702634494
Issue #10213 Ensuring proper usage of StartLog logging (to prevent accidental exceptions) (#10214) 2023-08-17 07:37:40 -05:00
Lachlan Roberts 8c645abf7f make some protected methods private in FormAuthenticator
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-17 17:27:11 +10:00
Lachlan Roberts 1b6b8331fa fix bug in SecurityHandler and remove EE10 FormAuthenticator
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-17 15:44:20 +10:00
Lachlan Roberts 9208629e95 make the dispatch feature work for core securityHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-17 15:32:40 +10:00
gregw db5209e97a Implement ServeAs in core SecurityHandler 2023-08-17 11:18:08 +10:00
Joakim Erdfelt fd1413db58
Issue #10274 - Improve javadoc + move internal methods (#10276)
* Improve javadoc + move internal methods
2023-08-16 16:09:36 -05:00
Simone Bordet 24792db09c Fixes #10218 - NPE in HttpChannelOverFCGI.receive()
Simplified the code, removing all leftover cruft present since FCGI was multiplexed.
Now the FCGI implementation is very similar to HTTP1.

Made HttpConnectionOverFCGI.channel final so that it cannot NPE anymore.

The client now properly handling server-side connection closes.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-16 15:27:59 +02:00
Simone Bordet 17c3649771
Fixes #10217 - Review ProxyConnectionFactory buffer management. (#10225)
Fixed buffer leak in ProxyConnection classes.
Introduced ArrayByteBufferPool.Tracking to test buffer leaks.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-16 15:26:57 +02:00
Simone Bordet 8f6a38aca8 Added documentation to migrate from Servlet to Handler.
Introduced CompletableTask to simplify Content.Source reads.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-16 15:02:57 +02:00
Lachlan Roberts 87396105fb Issue #10295 - use ServletChannel states for the security handler dispatch
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-15 11:18:25 +10:00
Lachlan Roberts e9ab7498a9 Issue #10295 - create an EE10 FormAuthenticator
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-08-15 10:38:02 +10:00
Simone Bordet eb35e42cb6
Fixed documentation that was still referring to `Handler.process()` which has now become `Handler.handle()`.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-10 16:47:37 +02:00
Simone Bordet 6bd067cb5a
Suppressed exceptions during testing.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-08 11:44:22 +02:00
Joakim Erdfelt 9c324326c5
Merge `release/12.0.0` back into `jetty-12.0.x` (#10237)
* Updating to version 12.0.0

* Updating to version 12.0.1-SNAPSHOT
2023-08-08 00:55:19 +02:00
Greg Wilkins 70a7a6769c
Fix #10229 servlet Idle Timeout (#10233)
* Fix #10229  Idle Timeout

Added test to reproduce

Fixed NPE if no failure listener


Possible

Added test that idle works between requests

EE9 idle timeout

idle if read operation

Handle idleTimeout for IO operations differently

improve comments

fixed test to not expect timeout listener to be called if there is demand

Idle timeouts for IO operations are not last.

Disable transient idle timeouts since AsyncContentProducer cannot handle them.

revert test to persistent idle failures
2023-08-07 06:05:05 +10:00
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