* improve the formatting for precise ms in DateCache
* return original format string with DateCache.getFormatString
* calculate index in tick constructor because format strings can be different size
* use two ticks so that switching between seconds is less likely going to have cache miss
* use boolean instead of index to denote if sub second is needed
* remove formatWithoutCache and replace with doFormat as it doesn't work with sub second time
* allow the option of not having sub second precision
* use two separate formatters for the prefix/suffix around the SSS format code
* use a simple class to store both ticks in DateCache
* rename DateCache.Tick.getString(long) to format()
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Introduced module `threadpool-virtual` for Java 21.
* Updated virtual threads documentation to refer to Java 21.
* Updated requirements that the releases should use Java 21, so that the documentation can properly render the virtual threads documentation.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Now Content-Length and Content-Encoding are removed/modified by the decoder.
In this way, applications have a correct sets of headers to decide whether to decode the content themselves.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Now TunnelRequest.getURI() does not return null, so normalizeRequest() can properly apply the authentication headers.
Moved copy of a request to HttpRequest, so also the sub-type can be copied.
Fixed restore of destination in HttpProxy.HttpProxyClientConnectionFactory.newProxyConnection(): now doing it in the promise rather than in finally block.
Using the proxy destination (not the server's) to send subsequent CONNECT requests in case the first is not replied with 200.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Fixes#8405 - onAllDataRead() is called twice under h2 if the stream times out
Per Servlet semantic, HTTP/2 stream timeout should be ignored.
The code was trying to fail the read via `_contentDemander.onTimeout()`, but
then it was still calling `onContentProducible()`, which was returning `true`
because the state of the read was IDLE (all the request content was read) and
the request was suspended.
Now the code checks if the read was really failed; if it is not, then
`onContentProducible()` is not called and so the idle timeout is ignored.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Method HTTP2StreamEndPoint.flush() has a "no pending operation" semantic, but the previous implementation was calling stream.data(), which may become a pending operation if the stream is congested.
Changed the implementation of flush() to return false in the IDLE and PENDING cases.
Now every flush() is converted to a write(), which has the same semantic as stream.data().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
The handling of reads in MultiPartByteRanges.PathContentSource was broken for ranges that were larger than the read buffer size.
Fixed by properly counting how many bytes are left to read.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Updating various old/moved URL references found across project (`jetty-10.0.x`) (#10098)
+ Now that the migration of `https://eclipse.org/jetty/` to `https://eclipse.dev/jetty/` has occurred, it is time to review the URI use in our project
+ Updated URLs in poms
+ Added more URIs to XmlConfiguration
+ Updated URLs in module files
+ Updated URLs in documentation
+ Updated URLs in HTML
+ Correcting bad double-scheme URLs (eg: `http://https://www.eclipse...`)
+ Updating text in *.mod files
+ Removing `/current/` from path `/jetty/documentation/current/`
+ Fixing mailing list URL
+ Fixing github URL references in jsps
---------
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
* Add zone id to DateTimeFormatter
Inline the call to withZone(ZoneId) because it returns a new DateTimeFormatter instead of modifying the current one in-place
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
* Remove redundant null-check
The array already was null-checked, so remove the redundant check
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
* Cleanup ArrayUtil
ArrayUtil provides static methods only -> Prevent instantiation and remove unused interfaces
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
* Remove dead assignment
The charset variable isn't accessed after the assignment anymore
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
* Prevent instantiation
TypeUtil contains static members only and should not be instantiated
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
* Remove redundant null-check
The loader variable is checked to be non-null before
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
* Restrict charset to ascii
The JavaDoc describes the byte array to contain ascii characters only
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
* Prevent instantiation
StringUtil contains static members only
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
* Prevent instantiation
IO contains static members only
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
---------
Signed-off-by: Steffen Nießing <zuniquex@protonmail.com>
This PR refactors the ee10 handing of servlet API request and response objects:
+ The ServletContextHandler matches the request to a servlet and creates a one time only ServletContextRequest and a ServletContextResponse
+ A reusable ServletChannel object with all the heavy weight HttpInput and HttpOutput object is associated with the ServletContextRequest and ServletContextResponse.
+ Once the handling reaches the ServletHandler, the possibly wrapped request, response and callback are associated with the ServletChannel before handling.
+ Were possible the ServletApiRequest and ServletApiResponse use the possibly wrapped request/response
Added tests to check that GzipHandler can now be nested inside of an EE10 context.
---------
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: gregw <gregw@webtide.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
* jetty-slf4j-impl is non-optional on some modules
* Using appropriate slf4j impl depending on module.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>