Commit Graph

94 Commits

Author SHA1 Message Date
gregw b11996a3c4 Introduced EE11 and jetty-12.1.x 2024-04-26 22:42:57 +10:00
Ludovic Orban 656e904d91
Fix buffer leak in `HttpClientStreamTest.testUploadWithConcurrentServerCloseClosesStream()` (#10431)
Fix buffer leak in HTTP and FCGI when the server is being shut down while there are in-flight requests

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2024-04-22 16:15:58 +02:00
Joakim Erdfelt b3ef872d6b
Updating to version 12.0.9-SNAPSHOT 2024-03-29 15:20:11 -05:00
Joakim Erdfelt ffffdcc3c8
Updating to version 12.0.8 2024-03-29 14:31:57 -05:00
Joakim Erdfelt 18b2a7c201
Updating to version 12.0.8-SNAPSHOT 2024-02-29 16:00:27 -06:00
Joakim Erdfelt c89aca8fd3
Updating to version 12.0.7 2024-02-29 15:18:56 -06: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
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
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
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
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 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
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
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
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
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
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
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
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
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 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
Greg Wilkins 09710c7cb6
Fix jetty 12 javadoc (#10527)
Fixes for javadoc warnings
2023-09-18 17:30:02 +10: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
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
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
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 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 042841a7c6
Fix #10306 getServerHost (#10311)
Fix #10306 getServerHost
2023-08-18 10:11:39 +10: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
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
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 a3e82326cf
Experiment/jetty 12 chunk isError and warnings (#9904)
* Remove usage of instanceof Content.Chunk.Error
* Updated AsyncContent to accept a transient failures
* Updated AsyncContent to accept a transient failure with inputstream
2023-06-23 09:17:15 +02:00
Ludovic Orban 8e79c1b58b
Add `EventsHandler` API (#9901)
* #8885 add EventsHandler API

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-15 17:31:11 +02:00
Greg Wilkins 963d33111e
Jetty 12 idletimeout (#9905)
* IdleTimeout review

 + pass TimeoutException through all APIs
 + HttpConnection now passes on TimeoutException to HttpChannel.onFailure
* More ServerTests for idletimeout

* Recreated a ServerTimeoutsTest for multiple transports

* more robust tests

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

* merged work from @sbordet and @gregw

* Various improvements to CyclicTimeouts.
* Improved reset of the earliest timeout before iteration.
* Removed check for getExpireNanoTime() == -1, since it's a valid value.
* When onExpired(Expirable) returns false, the Expirable should arrange to move its timeout in the future.

* fix keystore to please BoringSSL + use correct temp path

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

* Fixed ErrorResponseAndCallback succeeded() and failed() to call super.failed() in all cases to complete the wrapped callback.

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

* Revert "Fixed ErrorResponseAndCallback succeeded() and failed() to call super.failed() in all cases to complete the wrapped callback."

This reverts commit 5ac57c13e0.

* WIP idleTimeout

* WIP idleTimeout

* Added context wrapper for idle timeout listener

* updates from review

---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-14 09:57:10 +02:00
Simone Bordet 476145b817
Fixed FCGI content parsing. (#9790)
* Fixed FCGI content parsing.

WordPress sends the initial content in the same frame as the response headers.
StreamContentParser was receiving the frame, delegating to HttpParser to parse the headers,
but the buffer was still containing some content, that was lost.
Now the content after the headers is correctly retained.

For the direct FastCGI APIs, now a read-only version of the buffer is passed to the listener,
and the original buffer is consumed as the caller expects.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-25 15:22:30 +02:00
Simone Bordet e0ff8cd1a5
Simplified and fixed TryPathsHandler. (#9792)
Improved logging and variable naming in related classes.

Previously, a 404 received from a child handler would have resulted in an infinite loop trying to write the 404 response. However, `TryPathsHandler` should just delegate to other handlers.

Replaced the `IteratingCallback` loop with a simple `for` loop over the paths to try, returning if the path was handled by a child `Handler`.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-23 21:26:35 +02:00
Simone Bordet b884469103
FCGI improvements. (#9733)
* FCGI improvements.

* Better handling for HTTPS parameter on server side.
* Better handling of unknown frame types.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-15 15:04:50 +02:00
Greg Wilkins 4c16e6a707
Jetty 12 content length 0 take3 (#9740)
* Optimize Content-Length: 0 handling

Create and use a pre-encoded HttpFields.CONTENT_LENGTH_0 constant
Used the constant in more places
renamed the `putLongField` methods of HttpFields.Mutable to just `put`
Fixed wrong docs examples
2023-05-07 19:22:15 +02:00
Simone Bordet 7ffdd7fd05
Removed unnecessary "Adapter" classes.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-21 18:49:51 +02:00
Simone Bordet 744b37f80b
Fixes #7608 - Jetty-12 MetaData cleanup needed (#9618)
* Removed unnecessary constructors from MetaData, MetaData.Request and MetaData.Response.
* Removed MetaData.Request.getURIString() (available as getHttpURI().toString()).
* Renamed MetaData.getFields() -> getHttpFields(), as they can be headers or trailers.
* Renamed MetaData.Request.getURI() -> getHttpURI().
* Normalized handling of contentLength, now always -1 (rather than Long.MIN_VALUE) if unknown.
* Permutated MetaData.Response constructor parameters to be consistent with MetaData.Request.
* MetaData.Request's method and httpURI must be non-null.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-07 21:23:01 +02:00