Commit Graph

1614 Commits

Author SHA1 Message Date
Ludovic Orban 1e6240e2f4
Fix NPE in HttpReceiverOverHTTP2.read() when the channel's stream is null (#11443)
* Added null guard.
* Avoid executing the event actions in case the response is either complete or (new change) terminated.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-27 15:59:17 +01:00
Joakim Erdfelt bb646ed085
Improve jetty-util on Windows (#11440)
* Improve jetty-util on Windows
* Enable ATOMIC_MOVE on Resource.copyTo()
* Add reference to Resource impl in exception.
* Attempting to address sneaky Windows path strings that look like URIs
* Deprecate URIUtil.correctFileURI in favor of new URIUtil.correctURI method
2024-02-27 06:32:44 -06:00
Joakim Erdfelt 866f44584c
Issue #11361 - UriCompliance.checkUriCompliance improvements (#11444)
* Issue #11361 - UriCompliance.checkUriCompliance improvements
2024-02-27 06:32:07 -06:00
Lachlan d3f19bb947
Merge pull request #11402 from jetty/jetty-12.0.x-11398-WebSocket-CloseChannelException
Issue #11398 - allow frames to be demanded in WebSocket onOpen
2024-02-27 17:11:53 +11:00
Lachlan 4f1401438a
Merge pull request #11433 from jetty/fix/jetty-12.0.x/11278-symlink-dir-listing
Issue #11278 - fix 500 response when trying to display symlinked directory
2024-02-27 17:10:55 +11:00
Simone Bordet 6facb0f7f5
Fixes #11370 - IllegalStateException when last write fails. (#11439)
Removed the call to `ServletChannel.abort()` from the write callback.

As the write was issued from `ServletChannel.handle()` case COMPLETE, it was eventually calling `ServletChannelState.completed(Throwable)`, which is expecting the requestState to be COMPLETING.
However, calling `abort()` would set the requestState to COMPLETED, causing the IllegalStateException.

There should be no need to call `abort()` from the callback of failed writes, since failing the various callbacks should be enough, eventually failing the `HttpStream`, which would take care of tearing down the connection (HTTP/1) or the stream (HTTP/2+).

Now aborting the response from ServletChannelState.completed(Throwable).
Fixed SizeLimitHandler exception message.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-26 17:27:20 +01:00
Simone Bordet 24c1140917
Fixes #8979 - Jetty 12 - HttpClientTransport network "modes". (#11368)
* Introduced oej.io.Transport as the abstraction for the low-level transport of high-level protocols.
Now protocols such as HTTP/1.1 or HTTP/2 can be transported over TCP, QUIC, Unix-Domain, memory, and possibly over other low-level custom protocols too.
* Introduced oej.client.Request.transport(Transport) to specify Transport for each request.
* Introduced Transport to [HTTP2Client|HTTP3Client].connect(...) methods.
* Introduced [Client|Server]QuicConfiguration so that it can be used in other Connectors such as MemoryConnector.
* Introduced oej.server.MemoryConnector and EndPoint.Pipe for memory communication between peers, along with a MemoryTransport.
* Introduced QuicTransport as a wrapper for other Transports, so that QUIC can now also be transported over memory.
* Improved javadocs and documentation.
* Removed usage of ClientConnector.forUnixDomain() from FastCGIProxyServlet (ee10 and ee9).
* Replaced usage of HTTP3ServerConnector with QuicServerConnector in jetty-http3.xml.
* Fixed handling of Instruction notifications in case of re-entrance.
Now first clear the list, then notify to avoid that when re-entering the same instruction is notified multiple times.
* Introduced ContentSourceRequestContent, and updated ProxyHandler to use it.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-26 17:24:24 +01:00
Jan Bartel a1cb4750d7
Jetty 12.0.x 11377 fix jettyhome osgi path (#11418)
* Issue #11377 fix jettyhome osgi path and  WebInfConfiguration.unpack for windows
2024-02-26 12:07:10 +01:00
Simone Bordet 535e772c7e Updated code to use new UnixDomain APIs explicitly, rather than via reflection.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-23 18:47:24 +01:00
Simone Bordet 9b64130ddc
Fixes #11432 - Review number of acceptor threads. (#11436)
Defaulted to 1.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-23 15:33:27 +01:00
Ludovic Orban efc2785014
Fix buffer leaks in FCGI and H3 `HttpClientIdleTimeoutTest` (#10432)
#10226
- fix HttpClientIdleTimeoutTest to wait for server's idle timeout before checking for leaks
- improve HttpClientIdleTimeoutTest by making it upload some content
- fix FCGI server leak caused by idle timeout
- fix H3 server leak caused by idle timeout

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-02-23 13:36:58 +01:00
Lachlan Roberts 5826e56666 PR #11433 - fix for symlink loops in Resource.getAllResources
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-23 15:44:01 +11:00
Lachlan Roberts 4ca044486e PR #11402 - move methods to original position in WebSocketConnection
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-23 11:18:17 +11:00
Joakim Erdfelt bfac61cd89
Issue #11424 - Document default of `jetty.deploy.scanInterval` at `0` (#11437)
+ Update documentation and defaults in mod files
2024-02-22 14:25:01 -06:00
Lachlan Roberts 9234331d62 Issue #11278 - fix 500 response when trying to display symlinked directory
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-22 17:32:50 +11:00
Lachlan Roberts 436f4f8507 PR #11402 - changes for review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-22 15:56:52 +11:00
Lachlan 33e00dc452
Merge pull request #11279 from jetty/jetty-12.0.x-11271-AliasCheckCombinedResource
Issue #11271 - fix use of AliasCheckers with CombinedResource
2024-02-22 08:48:54 +11:00
Greg Wilkins 750584bc85
Experiment with ArrayByteBufferPool performance (#11426)
* Experiment with ArrayByteBufferPool

No overall size accounting
reserved buffer release always checks max memory
released buffers check max memory 1% of the time.
only a single thread can check memory at once.
single pass through buckets so no looping forever.

* Experiment with ArrayByteBufferPool

updates from review

* JMH updates

* updates from review

* Fixed comments.
Fixed call to recordEvict().
Removed unused methods.
Method getAvailable*Memory() no longer JMX-enabled, as they are the same as get*Memory().

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

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 22:03:00 +01:00
Ludovic Orban 509ede1d85
Add jersey test module (#11423)
Add jersey test module

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 22:00:07 +01:00
Simone Bordet f3b37bc277 Fixes #8887 - Jetty-12 client calls onDataAvailable with producing thread.
Now the calls to the upper layer produce tasks that are fed to the ExecutionFactory in HTTP2Connection.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 21:47:45 +01:00
Joakim Erdfelt 2d51170be2
Fixes #11310 - multipart parser dropping some relevant CR bytes in parts (#11409)
Fixed case in MultiPart.Parser where a small chunk contains part of the boundary.

Added and fixed related tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-21 21:43:26 +01:00
Danish Nawab f8601750f3
Fixes #11353 named virtual thread executor (#11430)
Introduced `VirtualThreads.getNamedVirtualThreadsExecutor(String namePrefix)` to allow users/libraries to name virtual threads if they so wish.
2024-02-21 21:38:58 +01:00
Ludovic Orban 3a6ad49271
Jetty 12: `ContextHandler.getTempDirectory()` does not respect the `Context.getTempDirectory()` contract (#11397)
#11396 fix ContextHandler.getTempDirectory() so it never returns null as the contract mandates

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-02-21 09:26:34 +01:00
Joakim Erdfelt aa5eff978c
Issue #11410 - PathMappingsHandler does not set Server on added handlers (#11412)
* PathMappingsHandler does not set Server on added handlers
2024-02-20 14:08:44 -06:00
Greg Wilkins f07d812698
Fix #11414 URI schema and port normalization (#11416)
* Issue #11414 - use HttpURI instead of URIUtil to have a single point of spec behavior

* Issue #11414 - enforce lowercase scheme in HttpConfiguration.secureScheme

* Issue #11414 - Scheme produced on `Location` header is lowercase

* Issue #11414 - Scheme to lowercase

* Issue #11414 - Scheme to lowercase

* Revert change to HttpClient

* Added schema port knowledge to URIUtil

* Fixed tests for normalized URIs

* updates from review

* updates from review

* Fix tests

* Restored methods as deprecated

* More testing

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-02-20 20:12:55 +01:00
Simone Bordet d02406c164
Fixes #11371 - Review ArrayByteBufferPool eviction. (#11400)
* Fixes #11371 - Review ArrayByteBufferPool eviction.

* Eviction is now performed on release(), rather than acquire().
* Memory accounting is done on release(), rather than acquire().
This is because we were always exceeding the memory usage on acquire(), by returning a non-pooled buffer.
We only need to account for what is idle in the pool, and that is done more efficiently on release(), and it is leak-resistant (i.e. if the buffer is not returned, the memory is already non accounted for, keeping the pool consistent).
* Released entries now give precedence to Concurrent.Entry, rather than Queued.Entry, so the queued pool is always kept at minimum size.
* Changed eviction algorithm to be simpler: one pass through the buckets excluding the current, trying to remove idle buffers until enough memory is recovered.
If successful, the buffer being released is pooled, otherwise it is also discarded.
* Added detailed statistics to ArrayByteBufferPool.RetainedBuckets.
* Added statisticsEnabled property in Jetty module bytebufferpool.mod.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-20 11:02:11 +01:00
Simone Bordet 624ee584bd
Issue #6140 - SelectorManager total keys.
Removed toString() override that was not calling super, to restore printing the total number of keys in dumps.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-20 10:21:35 +01:00
Greg Wilkins 08174a3042
Fix #11401 StringBuilder rather than StringBuffer (#11406) 2024-02-19 14:52:17 +00:00
Greg Wilkins b89c7ebefe
Do not throw from HttpChannelState.read() method (#11369)
Fixes #11363 by ensuring that read never throws, but instead returns an Error chunk.
2024-02-19 08:28:16 +00:00
Lachlan Roberts 0ece73b769 PR #11402 - add check for null networkBuffer in WebSocketConnection
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-16 16:19:31 +11:00
Lachlan Roberts 6b079acf78 PR #11279 - move isSameFile method to Resource
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-16 10:47:51 +11:00
Lachlan Roberts 87aeefbbc9 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-11271-AliasCheckCombinedResource 2024-02-15 23:48:40 +11:00
Lachlan Roberts 783c14cec4 Issue #11398 - do not deliver messages until onOpen completes
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-15 13:07:28 +11:00
Hervé Boutemy 3d3682597f
drop buildnumber:create already executed by jetty-util (#11360)
* drop buildnumber creation already done by jetty-util
* copy build.properties from jetty-util
2024-02-15 02:52:01 +01:00
Joakim Erdfelt 645e775114
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2024-02-14 16:11:05 -06:00
Simone Bordet 0e79997965 Fixes #11403 - Expose SslEndPoint in SslHandshakeListener
Now also exposing the `EndPoint` in SslHandshakeListener.Event.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-14 13:41:48 +01:00
Lachlan 55e3072247
Merge pull request #11357 from jetty/jetty-12.0.x-ServerWebSocketContainer-ensure
Issue #11356 - Allow ServerWebSocketContainer to be created without ContextHandler
2024-02-14 20:18:20 +11:00
Lachlan Roberts 25fb7be7a9 Issue #11398 - allow frames to be demanded in WebSocket onOpen
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-14 15:20:34 +11:00
Simone Bordet 2a72ded229 Fixed ArrayByteBufferPoolTest, making it not sensible to random GC cycles that may modify the pool by removing buffers that were leaked in the tests.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-09 15:44:02 +01:00
Joakim Erdfelt 4511d5e4a5
Making FormFields get defaults from Context, not Request. 2024-02-07 11:59:38 -06:00
Simone Bordet 7e4621fea4 Fixes #11372 - Scheduler queue in the HTTP client grows infinitely when a server times out
Fixed regression introduced with #9897.
After onExpire() returns false, the entity is asked again the expirationNanoTime, but there was no check whether it was Long.MAX_VALUE, indicating that the entity should not be rescheduled.

This was causing scheduling of timeouts far in the future (about Long.MAX_VALUE nanos away), but each at a slightly different time, causing the leak.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-02-05 17:47:23 +01:00
Lachlan Roberts e3c9e2fd54 PR #11357 - fix checkstyle errors
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-02 13:41:56 +11:00
Lachlan Roberts bbdaf072db PR #11357 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-02 13:31:28 +11:00
Lachlan Roberts 077f9bcf61 PR #11357 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-02-02 13:20:52 +11:00
Lachlan Roberts 07d97de2cd PR #11279 - clarify javadoc in TrailingSlashAliasChecker
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-31 11:30:13 +11:00
Lachlan Roberts 03313567e8 PR #11279 - fixes for AliasCheckerMultipleResourceBasesTest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-31 01:13:08 +11:00
Lachlan Roberts ee1d24ffdb Issue #11356 - Allow ServerWebSocketContainer to be created without ContextHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-30 20:39:13 +11:00
Lachlan Roberts 1398bf930e add example in javadoc for TrailingSlashAliasChecker
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-30 15:36:29 +11:00
Joakim Erdfelt 82d9177f0c
Updating to version 12.0.7-SNAPSHOT 2024-01-29 21:04:51 -06:00
Joakim Erdfelt 78ab6e6ba1
Updating to version 12.0.6 2024-01-29 20:42:49 -06:00
Lachlan Roberts a1c49c6322 add TrailingSlashAliasChecker to fix tests
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-30 11:17:44 +11:00
Ludovic Orban 58eaa5f45a Merge remote-tracking branch 'origin/jetty-11.0.x' into fix/jetty-12.0.x-11349-merge-from-11 2024-01-29 22:06:32 +01:00
Lachlan 554d5b19d5
Issue #11275 - explicitly close websocket endpoint after error from DispatchedMessageSink (#11343)
* Now properly handling errors
* Added test for partial read

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-29 15:13:25 +01:00
Simone Bordet a33dd59b21 Fixes #11339 - Content-type additional parameters.
Fixed handling of Content-Type in FormFields.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-29 15:07:41 +01:00
Lachlan cb60e2a968
Merge pull request #11309 from jetty/jetty-12.0.x-ensureCallbackComplete-WebSocketCoreSession
ensure callback is always completed in WebSocketCoreSession
2024-01-29 11:29:31 +11:00
Simone Bordet 4e28331595
Fixes #11095 - IllegalStateException for completed requests with GzipHandler (#11210)
* In ServletChannel, in COMPLETE state, there was a check comparing the number of bytes written with that declared by Content-Length.
Unfortunately the check was wrong in case of gzip, because it was comparing the application length with the gzipped length, resulting in a late sendErrorOrAbort() that was an abort() because the response was already fully sent.
Furthermore, if sendErrorOrAbort() was actually an abort(), there was an unnecessary attempt to complete the output.
* In GzipHandlerResponseAndCallback there were 2 last writes: one when the application calls output.close(), and one when the callback is succeeded.
Furthermore, when no content needs to be written, it was still compressed, causing an IOException in ChannelResponse (again when double-checking the bytes written, since Content-Length was 0, but the gzip header and trailer were written).
* Updates semantic of when to add the "Vary" header.
Now it is always only added by GzipHandler, when it would be possible to generate a response that might be compressed (even if it will not).
* Added *.bz2 mime-type.
Updated GzipHandler with the correct mime-type for *.bz2: application/x-bzip2.
* Improved checks for the number of bytes written against declared content-length.
This is necessary because welcome files are written by DefaultServlet (most of the times) bypassing the Servlet classes, using ServletContextResponse directly.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-01-27 10:50:30 +01:00
Greg Wilkins c6c5f07d51
Fixes for Spring core integration (#11288)
* Cleanup of HttpFields to improve spring integration

* Fixed Subscriber for spring integration

* Fixed implementation of ContentSinkSubscriber.
Added comment to clarify behavior of ContentSinkPublisher.

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

* Apply suggestions from code review

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

* updates from review

* updates from review

* updates from review

* updates from review

* fix canRetain

* updates from review

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2024-01-26 12:18:51 +09:00
Joakim Erdfelt 985b290ee6
Merge pull request #11321 from jetty/fix/12.0.x/addbean-debug-this-fix
Issue #11317 - Low hanging fix for LOG.debug in addBean.
2024-01-25 19:56:46 -06:00
Simone Bordet b5d0fd6f2f
Fixes #11096 - IllegalAccessException when invoking WebSocket endpoint methods in Jetty 12 (#11229)
Changed `JettyWebSocketFrameHandlerFactory` to use an application MethodHandle.Lookup (rather than a server one) when creating listener metadata.
This fixes the JPMS problem so that now JPMS applications do not need any additional configuration to invoke endpoints.
The (acceptable) downside is that anonymous inner classes (that are not public) cannot be used as listener endpoints.

This change affects core and EE10 WebSocket; EE9 and EE8 WebSocket have not been fixed (so they allow anonymous inner classes but are broken in JPMS).

Renamed "connectLatch" fields to "openLatch" in test classes.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2024-01-25 16:40:48 +01:00
Joakim Erdfelt ef75595e8e
Merge pull request #11306 from jetty/fix/jetty-12/11282/debug-deadlock
Fixes #11282 - Deadlocks with DEBUG logging enabled in jetty-server testing.
2024-01-25 09:26:49 -06:00
Joakim Erdfelt 7cebef880a
Issue #11317 - Low hanging fix for LOG.debug in addBean. 2024-01-25 08:59:56 -06:00
Joakim Erdfelt 08af80329b
Issue #11281 - fix two NPEs seen during MultiPart with DEBUG enabled (#11313) 2024-01-25 07:43:11 -06:00
Joakim Erdfelt 9df827b802
Issue #11220 - ContextHandler NPE protections (#11318)
+ add protection for NPE seen during constructor initialization.
+ Javadoc fixes
2024-01-25 07:41:59 -06:00
Lachlan Roberts c1e2d47968 fix bug in HotSwapHandler
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-25 15:00:45 +11:00
Lachlan Roberts 642f5840a3 clarify the behaviour of SymlinkAllowedResourceAliasChecker and change behaviour
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-25 14:49:43 +11:00
Joakim Erdfelt 3853628074
Issue #11253 - Cleanup ComplianceViolation behavior to allow Cookie / URI / MultiPart compliance to also receive listener events. (#11254)
+ Introduce new events on `ComplianceViolation.Listener`
+ Introduce new `ComplianceViolation.Listener.initialize()` to allow for a new Listener at the appropriate time (to support per-request listeners)
+ Introduce new `ComplianceViolation.CapturingListener`
+ Introduce new `HttpConfiguration.(add/remove/get)ComplianceViolationListener()` methods.
+ Deprecate/Remove handling of `recordComplianceViolations` in `HttpConnection` and `HttpConnectionFactory` classes.
+ Produce warnings if use of `ComplianceViolation.Listener` as beans is still present.
+ Add `ComplianceViolation.Listener` support to `UriCompliance` locations.
+ Add `ComplianceViolation.Listener` support to `MultiPartCompliance` locations.
+ Add `ComplianceViolation.Listener` support to `CookieCompliance` locations.
+ Add `ComplianceViolation.Listener` support to `HttpCompliance` locations in HTTP/2 and HTTP/3

---------

Co-authored-by: gregw <gregw@webtide.com>
2024-01-24 08:24:05 -06:00
Ludovic Orban aa3873fb2f
Fix incorrect reliance on autoDemand when handlers are not configured (#11304)
#11303 fix incorrect reliance on autoDemand when handlers are not configured

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-01-24 09:11:25 +01:00
Jan Bartel 8163219dda
Issue #11296 Fix javadoc on AbstractLoginModule (#11297)
* Issue #11296 Fix javadoc on AbstractLoginModule
2024-01-24 06:46:29 +01:00
Lachlan Roberts 6b20ee0753 ensure callback is always completed in WebSocketCoreSession
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-24 12:00:46 +11:00
Lachlan Roberts 1e0c0b42ab ensure callback is always completed in WebSocketCoreSession
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-24 11:57:34 +11:00
Simone Bordet aa21612006
Fixes #11282 - Deadlocks with DEBUG logging enabled in jetty-server testing.
Introduced AutoLock.tryLock() to use it in the toString() implementations that lock in order to retrieve a consistent state to produce the string.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-23 22:04:57 +01:00
Greg Wilkins a2d86c7f67
Fix #11290 empty field (#11291)
Fixed cacheable empty field for #11290
2024-01-18 22:21:43 +00:00
Joakim Erdfelt 8cc7abe412
Adding testHostOnlyPort example from Issue #11287 2024-01-18 09:27:05 -06:00
Lachlan Roberts 7cee769276 fix check in SymlinkAllowedResourceAliasChecker
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-18 09:55:51 +11:00
Joakim Erdfelt 8368deea7e
Issue #11263 - Reduce usage of glob lib/foo/*.jar in modules (#11264)
* Using @foo.version@ technique and proper
  lib lists to allow arbitrary version
  updates from properties
* Fix spotless
* Remove duplicate entries
* Only replace System property "jetty.version" with manifest-ver if blank/null
* Fixing bad module definitions
2024-01-16 10:46:58 -06:00
Lachlan Roberts c3cc4c7092 resolve protected targets every time
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-17 00:16:08 +11:00
Lachlan Roberts aaaf7aa67b fix alias checkers to allow use of CombinedResource
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2024-01-17 00:13:26 +11:00
Simone Bordet 0839a208cd
Fixes #11259 - HTTP/2 connection not closed after idle timeout when TCP congested. (#11267)
Now upon the second idle timeout, the connection is forcibly closed.
Fixed also similar problem in HTTP/3.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-15 17:29:05 +01:00
Joakim Erdfelt 2c7e07e516
Merge pull request #11262 from jetty/fix/12.0.x/javadoc-typos
Correct some javadoc typos
2024-01-12 08:12:58 -06:00
Simone Bordet c8cd6f4048
Fixes #11230 Problem with parsing of form parameters without values. (#11255)
Fixed parsing of form parameters in FormFields.parse().
Added more tests for valid edge cases, and invalid cases.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-12 11:22:02 +01:00
Simone Bordet a9e564ad8c
Fixes #10220 - Implement CrossOriginHandler. (#11093)
Introduced CrossOriginHandler.
Added cross-origin Jetty module.
Added CrossOriginHandler documentation to the programming guide.
Added CrossOriginHandler documentation to the operations guide.
Added cross-origin headers to the HttpHeader enum.
Added test cases.
Deprecated ee10 CrossOriginFilter.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-12 09:57:21 +01:00
Joakim Erdfelt c8914c081a
Adding missing javadoc 2024-01-11 11:27:57 -06:00
Joakim Erdfelt 6326c2b962
Fix javadoc typos on client request content() to body() 2024-01-11 11:27:40 -06:00
Joakim Erdfelt 3a867c40f5
Fix javadoc typos 2024-01-11 11:26:20 -06:00
Simone Bordet 581f9ae9f4
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-08 10:19:20 +01:00
Joakim Erdfelt 62e073c52c
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2024-01-03 14:08:11 -06:00
Simone Bordet 80a04a554f
Fixes #11098 - Sporadic NPE in ArrayByteBufferPool.evict(). (#11204)
* Reorganized ArrayByteBufferPool.evict() code to avoid NPE.
* Fixed acquire logic to take into account that a reserved entry may fail to be enabled because it may be concurrently removed.
* Small change to ConcurrentPool: no need to null check the final ConcurrentEntry.holder field.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-03 15:56:36 +01:00
Simone Bordet 2a3e6f72c7
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2024-01-02 20:14:28 +01:00
Simone Bordet 2505d0e8a6
Merge pull request #11086 from jetty/jetty-12.0.x-11081-websocketRace
Issue #11081 - fix race condition in WebSocket FrameHandlers (jetty-12)
2023-12-29 14:44:58 +01:00
Lachlan 965e4af425
Merge pull request #11083 from jetty/jetty-12.0.x-11080-multipartRetainableChunks
Issue #11080 - copy ByteBuffer for non-retainable chunks
2023-12-20 12:19:30 +11:00
Lachlan Roberts 37a296dfdc Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x-11081-websocketRace 2023-12-20 12:12:13 +11:00
Lachlan Roberts 592ccf7da0 Issue #11080 - copy ByteBuffer for non-retainable chunks
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-12-19 15:11:43 +11:00
Joakim Erdfelt 96eea590ee
Updating to version 12.0.6-SNAPSHOT 2023-12-18 08:25:22 -06:00
Joakim Erdfelt 3aed62e495
Updating to version 12.0.5 2023-12-18 08:05:54 -06:00
Simone Bordet e481b45cda
Follow up for issue #10933 and associated PR #10949.
Fixed HttpChannelTest.testOnFailure().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-17 13:52:09 +01:00
Lachlan 62210d39c2
add deployment exception for non Jakarta WebSocket endpoints used in ServerEndpointConfig (#11032)
* Issue #11009 - add test for bad Jakarta endpoint
* Issue #11009 - ensure endpoint deployable before adding ServerEndpointConfig
* add same test and fix for ee9

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-12-17 13:37:10 +01:00
Simone Bordet fbf8dddae4
Follow up for issue #10933 and associated PR #10949.
Most often failures come from the read side, so failure listeners are now serialized in the _readInvoker.
This avoids that a failure while parsing a request (e.g. an early EOF) results in concurrent executions of the invokeOnContentAvailable task and the invokeOnFailureListeners task.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-17 13:33:59 +01:00
Simone Bordet c5e40f5d90 Implemented server-side reset of the stream using error code NO_ERROR in case the request content is not read.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-15 18:23:06 +01:00
Joakim Erdfelt 15c3369b16
Issue #10852 - Add ResourceHandler.setUseFileMapping(boolean) feature (#11071) 2023-12-15 11:12:26 -06:00
Lachlan 35af2d8984
Do not use HttpStream.Wrapper in SizeLimitHandler (#11051)
* Do not use HttpStream.Wrapper in SizeLimitHandler
* Updated the SizeLimitHandlerServletTest
* Udpated documentation and javadocs.

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-12-15 15:11:57 +01:00
Simone Bordet eb1e9eb8c4
Fixes #11016 - Jetty 12 IllegalStateException when stopping Server wi… (#11017)
* Made ServletChannel error handling more robust.
A failure in error handling is now remembered so that the Handler callback can be failed later.
* Avoid failing the Handler callback from ServletChannel.abort(), as it is too early: should be failed when processing the TERMINATED state, similarly to when it is succeeded.
* Removed dead code from HttpConnection.SendCallback.reset(), since response is always non-null.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-15 15:09:20 +01:00
Simone Bordet 3167e0cb6e
Fixes #11037 - Serialize HttpClient request failures (#11038)
* Introduced IteratingCallback.abort(Throwable) to serialize calls to onCompleteFailure().
* HttpSender now uses IC.abort() to serialize the abort of the request.
* Fixed HTTP/2 and HTTP/3 to dispatch the sending of the request to another thread, to free the reader thread that read the server preface.
* HTTP/1.1 does not need this, because just created connections do not need to read.
* Improved handling of request abort, as it can be from two sides: external and internal.
* Calling abort() instead of failed() for WebSocket flushers.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-15 14:44:15 +01:00
Joakim Erdfelt fa7ea8a13c
Merge pull request #11067 from kohlschuetter/pr/11066
Fixes #11066 - URIUtilTest.testFileUriGetUriLastPathSegment on macOS
2023-12-15 06:35:07 -06:00
Greg Wilkins f776d3e4fb
Issue #10933 - Fix AsyncIOServlet test issues (#10949)
* Call ServletChannelState.asyncFailure from error listener. Fix #10933
* Separate invokers for read side and write side
* document async error issues
* updates from review
* updates from review
2023-12-15 10:34:03 +11:00
Christian Kohlschütter 665f61a3e7 Fixes #11066 - URIUtilTest.testFileUriGetUriLastPathSegment on macOS
We special-cased this test on macOS to support NFD form normalization.

That may no longer be necessary, and therefore the test currently fails.

Run the default expectations, and, in case of failure on macOS, test
against the old workaround.
2023-12-14 22:25:29 +01:00
Joakim Erdfelt 2812023db3
Issue #11040 - Deprecate PathResource.SUPPORTED_SCHEMES (#11057)
* Using ResourceFactoryInternals.isSupported(URI) instead.
2023-12-14 13:54:11 -06:00
Simone Bordet 8f019b96b0 Fixes #11064 - Jetty 12: NPE if MultiPartFormData.setFilesDirectory() is not called.
Now trying to use $JETTY_BASE/work, otherwise throwing IllegalArgumentException with a descriptive message.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-14 19:44:05 +01:00
Ludovic Orban d974c4d798
Improve the dump output of ConcurrentPool (#11036)
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-12-14 19:24:53 +01:00
Simone Bordet 583bf0a28f Added tests to set the encoder/decoder dynamic table size to zero.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-14 09:17:26 +01:00
Simone Bordet e259dfaa81
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-13 21:32:26 +01:00
Jan Bartel d926380651
Refactor eeX plus.security and plus.annotation classes to core (#11030)
* Refactor eeX plus.security and plus.annotation classes to core
2023-12-13 06:34:55 +01:00
Simone Bordet 9888c67a11
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-12 20:25:17 +01:00
Simone Bordet 8a12ed57df
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-12 20:21:12 +01:00
Greg Wilkins b0d259118c
Fixes #10956 - Reviewed Expect 100 Continue Handler (#10957)
Removed duplicate handling from servlet. Now only handled in core in HttpChannelState and protected it from concurrent writes.
Added additional tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-12 16:01:11 +01:00
Joakim Erdfelt 835ec6f467
Merge remote-tracking branch 'origin/jetty-12.0.x' into fix/12.0.x/properties-update 2023-12-11 09:19:08 -06:00
Lachlan bd342ac6e0
Merge pull request #11034 from jetty/jetty-12.0.x-11021-websocket-upgradeListener
Issue #11021 - do not call UpgradeListener.onHandshakeResponse() in case of failures
2023-12-11 22:30:20 +11:00
Lachlan Roberts 363ebb3918 Issue #11021 - do not call UpgradeListener.onHandshakeResponse() in case of failures
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-12-11 14:48:07 +11:00
Simone Bordet 80c24fc876
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-09 18:08:12 +01:00
Joakim Erdfelt 5dbd14efd0
Merge remote-tracking branch 'origin/jetty-12.0.x' into fix/12.0.x/properties-update 2023-12-07 13:13:28 -06:00
Joakim Erdfelt 271b1ee2df
Merge remote-tracking branch 'jetty-11.0.x' into jetty-12.0.x 2023-12-06 15:21:13 -06:00
Joakim Erdfelt c582c2122b
Removing no longer used `jetty.byteBufferPool.*` properties
* `jetty.byteBufferPool.retainedHeapMemory`
* `jetty.byteBufferPool.retainedDirectMemory`
2023-12-06 14:52:54 -06:00
Joakim Erdfelt 3402fd58d4
Property `jetty.gzip.dispatcherTypes` no longer used in Jetty 12 2023-12-06 14:50:52 -06:00
Joakim Erdfelt 7d30f2e122
Property `jetty.statistics.gracefulShutdownWaitsForRequests` no longer used in Jetty 12 2023-12-06 14:49:58 -06:00
Simone Bordet 8638d80bd5
Fixes #10277 - Review read failures impacting writes. (#10948)
* Separated read failures from write failures.
* In this way it is possible to read even if the write side is failed and write even if the read side is failed.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-12-06 21:48:47 +01:00
Joakim Erdfelt d29eae280d
Making jdbc.schema configurations visible to tooling
The commented out (and optional) configurations

* `jetty.session.jdbc.schema.schemaName`
* `jetty.session.jdbc.schema.catalogName`

Are not represented as an empty key=value pair
so it wasn't being found by tooling.
2023-12-06 14:19:03 -06:00
Greg Wilkins 71354331e5
Issue #11014 - Cleanup of relative redirect handling Jetty-12 (#11019)
* Cleanup of relative redirect handling #11014
+ Handle request relative redirects
+ Moved to Response
+ Changed default to allow relative
* Updates to javadoc
2023-12-07 07:14:11 +11:00
Olivier Lamy 499d6127c8
Issue #11024 fix dependencies from jetty-security which should be test only
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-12-06 21:00:33 +10:00
Jan Bartel fd1c1e3c9b
Refactor JNDI across environments for common JNDI components that can be in core (#10897)
* Refactor jndi and plus to extract ee agnostic classes to jetty-core
2023-12-05 23:48:20 +01:00
Joakim Erdfelt 9a044fda67
Merge remote-tracking branch 'release/12.0.4' into jetty-12.0.x 2023-12-04 16:12:09 -06:00
Ludovic Orban 5b30fee459 Allocate the one byte array only when needed
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-12-04 19:26:46 +01:00
Ludovic Orban 8484a9da70 Fix ContentSourceInputStream mis-behaving in the presence of empty chunks
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-12-04 19:26:46 +01:00
Joakim Erdfelt 8597033339
Updating to version 12.0.5-SNAPSHOT 2023-11-30 13:33:03 -06:00
Joakim Erdfelt 9b415c6424
Updating to version 12.0.4 2023-11-30 13:14:15 -06:00
Lachlan 876796d7ca
Issue #10926 - add support for CombinedResource in AttributeNormalizer (#10927)
* #10926 - skip existence check if only one Normalizer
* fix for AttributeNormalizer

---------

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: gregw <gregw@webtide.com>
2023-11-30 13:02:13 -06:00
Simone Bordet 5d355ef473
Fixes #10943 - Flaky test ReservedThreadExecutorTest.testBusyEvict.
Made assert logic for aggressive reserved thread eviction more robust.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-29 17:38:14 +01:00
Simone Bordet 82fbf3d4e9
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-29 13:54:49 +01:00
Simone Bordet eba74d9bad
Improved ManagedSelector.toString() to report also the section statistics.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-29 13:14:34 +01:00
Simone Bordet a15a4b0a23
Fixes #10919 - EE10 multipart parsing may include '\r' at the front under certain conditions (#10921)
Setting MultiPart.Parser.crContent=false when the boundary is matched.
This is necessary when a read chunk ends with \r\n, and then matches the boundary on the next read chunk, and avoids to emit the CR as part content.

Fixed case of a chunk ending with \r.

Fixed case where a CR in a previous chunk is followed by a boundary at index 0 in the next chunk.
The CR should not be emitted as content, and crContent reset to false.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-29 09:17:04 +01:00
Greg Wilkins 41382b4e0e
Fix null host when checking virtual host #10922 (#10923)
Use the `Request.getServerName` static and check for null host.
2023-11-29 11:25:00 +11:00
Simone Bordet d1da7269f6
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-28 15:58:48 +01:00
Simone Bordet 8c10ea8a9b
Fixes #10912 - Document Request listeners (#10920)
* Fixes #10912 - Document Request listeners

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

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

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-27 17:14:31 +01:00
Simone Bordet c6fa7a8766
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-27 15:41:17 +01:00
Greg Wilkins 7dcab84b91
Fix jetty 12.0.x transient timeouts (#10844)
Fixes #10234

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

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

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

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

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

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

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-20 17:09:56 +01:00
Simone Bordet e933116997
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-19 22:09:10 +01:00
Simone Bordet d69dfc8d23
Fixes #10879 - Improve redirect handling with reproducible content (#10880)
* Fixes #10879 - Improve redirect handling with reproducible content

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

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Olivier Lamy <olamy@apache.org>
2023-11-17 11:53:36 +01:00
Joakim Erdfelt 2b3d811ea9
Don't track mounts for `newResource()` that doesn't exist (#10886)
* Don't track mounts for newResource() that doesn't exist.
* Cannot dereference if not tracking both resources that use the JAR.
* Only mount the root.  Check if root already mounted in mountIfNeeded

---------

Co-authored-by: gregw <gregw@webtide.com>
2023-11-15 07:26:29 -06:00
Ludovic Orban b436c85a63 Disable running SPNEGO test in parallel as its SimpleKdcServer server binds a static port
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-15 11:18:02 +01:00
Greg Wilkins 4dd8bc9ca3
reinstate HttpChannel reuse in H2 (#10868)
Reinstated HttpChannel reuse in H2.

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

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

---------

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

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-11-13 23:05:20 +11:00
Jan Bartel fb84f3f836
Issue #10829 downgrade expired session WARN to DEBUG (#10847)
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-11-13 04:35:24 +01:00
Greg Wilkins ca603ba56e
Recycle ServletChannel at ServletContextHandler completion. (#10866)
Fix bug with #10801 in that completion listeners were not well sequenced with stream wrappers.

---------

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-11-13 14:08:14 +11:00
Simone Bordet 561fd31462 Removed LeakDetector and LeakTrackingConnectionPool, not used anymore.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-11 18:20:22 +01:00
Greg Wilkins e800631120
Weak reference concurrent pool (#10787)
* The Pool is now a list of Holder instances, each with a WeakReference and a strong reference to an Entry.
* Removed thread-local cache from Pool.
* Avoid using deprecated ConcurrentPool constructors.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-09 22:32:50 +01:00
Greg Wilkins 6edd6d0ed0
Improve handling of SSL metadata in ConnectionMetaData, proxied connections and forwarded requests #10775 (#10853)
Improve handling of SSL metadata in ConnectionMetaData, proxied connections and forwarded requests

+ Added an Attributes.Synthetic mechanism to better (and mor commonly) handle additional attributes, whilst meeting the new TCK requirement that they can be deleted or replaced.
+ Made SslSessionData a reusable type provided by EndPoint
+ Added the EndPoint.Securable subtype that can provide a SslSessionData instance for secure EndPoints
+ Updated ForwardedRequestCustomizer, SecureRequestCustomizer to understand Securable and SslSessionData
+ Javadocs improvements.
+ Removed unnecessary attribute constants in SecureRequestCustomizer.

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

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-11-09 14:07:19 +11:00
Olivier Lamy b88908236e
Jetty 12 add duplicate classes finder plugin to avoid sames classes with different content coming from different jars (#10767)
* add duplicate finder plugin

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-11-07 06:37:41 +01:00
Olivier Lamy 91d11941b3
Jetty 12 merge from 11 and fix JAAS ldap login test (#10857)
* Merge from jetty-10.0.x to jetty-11.0.x

* Fixes #10812 - Correct awaitility dependency scope (#10813)

* Bump org.apache.logging.log4j:log4j-api from 2.20.0 to 2.21.1

Bumps org.apache.logging.log4j:log4j-api from 2.20.0 to 2.21.1.

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump maven.plugin-tools.version from 3.9.0 to 3.10.1

Bumps `maven.plugin-tools.version` from 3.9.0 to 3.10.1.

Updates `org.apache.maven.plugin-tools:maven-plugin-annotations` from 3.9.0 to 3.10.1
- [Release notes](https://github.com/apache/maven-plugin-tools/releases)
- [Commits](https://github.com/apache/maven-plugin-tools/compare/maven-plugin-tools-3.9.0...maven-plugin-tools-3.10.1)

Updates `org.apache.maven.plugin-tools:maven-plugin-tools-api` from 3.9.0 to 3.10.1
- [Release notes](https://github.com/apache/maven-plugin-tools/releases)
- [Commits](https://github.com/apache/maven-plugin-tools/compare/maven-plugin-tools-3.9.0...maven-plugin-tools-3.10.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugin-tools:maven-plugin-annotations
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.maven.plugin-tools:maven-plugin-tools-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump org.apache.maven.plugins:maven-clean-plugin from 3.3.1 to 3.3.2

Bumps [org.apache.maven.plugins:maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/apache/maven-clean-plugin/releases)
- [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.3.1...maven-clean-plugin-3.3.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-clean-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump org.apache.maven.plugins:maven-dependency-plugin

Bumps [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin) from 3.6.0 to 3.6.1.
- [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-3.6.0...maven-dependency-plugin-3.6.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-dependency-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump commons-io:commons-io from 2.14.0 to 2.15.0

Bumps commons-io:commons-io from 2.14.0 to 2.15.0.

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump org.apache.maven.plugins:maven-plugin-plugin from 3.9.0 to 3.10.1

Bumps [org.apache.maven.plugins:maven-plugin-plugin](https://github.com/apache/maven-plugin-tools) from 3.9.0 to 3.10.1.
- [Release notes](https://github.com/apache/maven-plugin-tools/releases)
- [Commits](https://github.com/apache/maven-plugin-tools/compare/maven-plugin-tools-3.9.0...maven-plugin-tools-3.10.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-plugin-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump maven.surefire.plugin.version from 3.1.2 to 3.2.1

Bumps `maven.surefire.plugin.version` from 3.1.2 to 3.2.1.

Updates `org.apache.maven.plugins:maven-failsafe-plugin` from 3.1.2 to 3.2.1
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.2...surefire-3.2.1)

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.1.2 to 3.2.1
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.2...surefire-3.2.1)

Updates `org.apache.maven.surefire:surefire-junit47` from 3.1.2 to 3.2.1

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-failsafe-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.maven.surefire:surefire-junit47
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump org.apache.maven.plugins:maven-checkstyle-plugin

Bumps [org.apache.maven.plugins:maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.3.0 to 3.3.1.
- [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.3.0...maven-checkstyle-plugin-3.3.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump apacheds.version from 2.0.0.AM26 to 2.0.0.AM27 (#10836)

* Bump apacheds.version from 2.0.0.AM26 to 2.0.0.AM27

Bumps `apacheds.version` from 2.0.0.AM26 to 2.0.0.AM27.

Updates `org.apache.directory.server:apacheds-test-framework` from 2.0.0.AM26 to 2.0.0.AM27
- [Commits](https://github.com/apache/directory-server/compare/2.0.0.AM26...2.0.0.AM27)

Updates `org.apache.directory.server:apacheds-server-integ` from 2.0.0.AM26 to 2.0.0.AM27
- [Commits](https://github.com/apache/directory-server/compare/2.0.0.AM26...2.0.0.AM27)

Updates `org.apache.directory.server:apacheds-core-integ` from 2.0.0.AM26 to 2.0.0.AM27
- [Commits](https://github.com/apache/directory-server/compare/2.0.0.AM26...2.0.0.AM27)

---
updated-dependencies:
- dependency-name: org.apache.directory.server:apacheds-test-framework
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: org.apache.directory.server:apacheds-server-integ
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: org.apache.directory.server:apacheds-core-integ
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* get this work

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Olivier Lamy <olamy@apache.org>

* Bump org.infinispan:infinispan-bom from 11.0.17.Final to 11.0.18.Final (#10724)

Bumps [org.infinispan:infinispan-bom](https://github.com/infinispan/infinispan) from 11.0.17.Final to 11.0.18.Final.
- [Release notes](https://github.com/infinispan/infinispan/releases)
- [Changelog](https://github.com/infinispan/infinispan/blob/main/Jenkinsfile-release)
- [Commits](https://github.com/infinispan/infinispan/compare/11.0.17.Final...11.0.18.Final)

---
updated-dependencies:
- dependency-name: org.infinispan:infinispan-bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* not needed, bad merge

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

* fix version

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Co-authored-by: Chad Wilson <chadw@thoughtworks.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 15:27:40 +11:00
Greg Wilkins 0ce52b9741
The replaceCookie method renamed to putCookie and refined #10797 (#10803)
Addressed #10797 by make cleanup of addCookie and renaming replaceCookie to putCookie.
Ensured that Jetty code calls putCookie when appropriate.
2023-11-02 07:07:54 +11:00
Ludovic Orban 5e747ac1e9
Stabilize `secondary_super_cache` in server code (#10802)
#10781 Stabilize secondary_super_cache in server code

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-11-01 09:28:33 +01:00
Greg Wilkins 2773bc7df8
Recycle ServletChannel in ServletContextHandler (#10801)
Recycle ServletChannel in ServletContextHandler rather than in ServletHandler, so that completion events on servlet API request/response can be handled.
2023-11-01 11:16:15 +11:00
Joakim Erdfelt c01baac85c
Updating to version 12.0.4-SNAPSHOT 2023-10-26 22:47:29 -05:00
Joakim Erdfelt a873259fd5
Updating to version 12.0.3 2023-10-26 22:24:43 -05:00
Joakim Erdfelt 4b3e7d1e90
Bump com.sun.xml.ws:jaxws-rt to 4.0.2 2023-10-26 20:36:08 -05:00
Olivier Lamy 8ba5ff1e9c
Issue #10688 add Jetty 12.0.x ee8 osgi (#10711)
* Add OSGi for ee8 environment

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-10-26 20:23:52 -05:00
Joakim Erdfelt 04475daf60
Issue #10794 - fixing Moved Permanently handling of query strings 2023-10-26 11:35:52 -05:00
Simone Bordet ab749237ce
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-26 17:27:37 +02:00
Jan Bartel a5f06fceaf
Add ability to compress and skip unserializable session attributes (#10747)
* Add ability to compress and skip unserializable session attributes
2023-10-26 09:36:45 +02:00
Joakim Erdfelt 1a0c0c32d2
Fixing 429 Too Many Requests from w3.org (#10789) 2023-10-26 14:26:45 +11:00
Jan Bartel 3ae43961b8
Jetty 12.0.x overlay combined resources (#10760)
* Fix overlays with CombinedResource
* Improvements to CombinedResource for AnnotationParser
* Added `contains` and `getPathTo` methods to the Resource API, so they can be used by the AnnotationParser
* Fixed numerous bugs in CombinedResource list and getAllResources
* handles cross file system copy as well.
* Reduced fallback to URI string manipulation.

---------

Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-10-26 07:49:48 +11:00
Simone Bordet 7bc856b1a3
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-25 12:21:51 +02:00
Lachlan Roberts 829e2a19b7 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2023-10-25 16:35:42 +11:00
Greg Wilkins 14152c425b
Better handling of Objects in JMX MetaData (#10762)
* Send attributes as Map<String,String>
* JMX-annotated ErrorHandler, fixed usage of showMessageInTitle and removed showServlet.
* JMX-annotated Request.Handler.
* Added JMX test module to test improvements to JMX.

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-24 10:03:28 +11:00
Olivier Lamy 2940528033
awaitility must be only test dependency (#10765)
Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-10-21 19:16:54 +10:00
Simone Bordet 2aba4117c2
Fixes #10477 - Jetty 12: Review MBeans for Handlers (#10754)
Updated base MBean class for o.e.j.server.Handler.
Also updated and modernized existing explicit MBean classes.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-19 23:48:51 +02:00
Jan Bartel 467f026d37
Jetty 12.0.x 10716 charset printwriter (#10737)
* Issue #10716 tck compliance for setting response charset

---------

Co-authored-by: gregw <gregw@webtide.com>
2023-10-19 05:09:42 +02:00
Simone Bordet a9bcbc6512
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-10-18 17:43:32 +02:00
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