Release request buffer before handling when there is no content
---------
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
* Reworked HttpReceiverOverHTTP state machine, in particular:
** Introduced a boolean parameter to parseAndFill() and parse(), that specifies whether to notify the application demand callback.
This is necessary because reads may happen from any threads, and must not notify the application demand callback.
Only when there is no data, and fill interest is set, then the application demand callback must be notified.
** Removed action field to avoid lambda allocation.
** Now the application is called directly from the parse() method.
** Reading -1 from the network drives the parser by calling again parse(), rather than the parser directly.
This allows to have a central place to notify the response success event.
* Fixed FastCGI similarly to HTTP/1.1.
* Removed leftover of the multiplex implementation.
* Fixed test flakyness in `NetworkTrafficListenerTest`: consume the request content before sending the response.
* Follow up after #10880: only abort the request if there is request content in `AuthenticationProtocolHandler` and `RedirectProtocolHandler`.
This avoids the rare case where the response arrives before the request thread has modified the request state, even if the request has been fully sent over the network, causing the request to be failed even if it should not.
* added `SerializedInvoker` assertions about current thread invoking.
* Name all SerializedInvoker instances for better troubleshooting.
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>
Fixes#11926 - Authority Customizer.
Introduced AuthorityCustomizer to synthesize the authority from the Host header (or serverName:serverPort), and related documentation.
Removed additional check on authority's host in `HttpCompliance`, as it was too strict and in the wrong place (authority checks should be factored out elsewhere for all HTTP protocol versions).
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #11925 - ee9 DefaultServlet and suffix url-patterns.
* Issue #11925 - Fix NPE in EtagUtils with URLResource
* Issue #11925 - Make error message "Base Resource should not be an alias" more useful.
* Set <reuseForks> to false for problematic tests.
Tweaks to the RBB API to make the concept more uniform throughout the codebase.
* Make chunk a RBB
* Added Dynamic RBB as a replacement for both Accumulator and Aggregator
---------
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
Introduces a ByteChannelContentSource which is needed for the spring framework integration.
It also introduces a few minor utilities:
a ByteBufferPool.Sized class that is a ByteBufferPool.Wrapper with a configured size and type so a no args acquire() method can be called. This avoid the need to many classes to have a three fields: pool, size and direct and also can avoid constructors/methods with size and direct
an ExceptionUtil.run(Runnable, Consumer<Throwable> failure) that is a simple try catch and avoids many private methods being created to do just that.
* Fix#11934 Servlet 6.1 Cookies
* Added compliance mode MAINTAIN_QUOTES to keep the quotes as part of the cookie value. Added mode RFC6265_QUOTED that includes this violation
* Never send a zero valued max-age parameter
* Partitioned is set if any attribute that is not "false" is set.
* Avoid equal sign for empty valued attributes
* Pushed responses delete max-age==0 cookies