The fix notifies the transport when a reset frame is received,
allowing the transport to fail the write callback which then notifies
the application, either by throwing (in case of blocking writes) or
by calling error listeners.
Also added a guard, in HttpChannel.handle() for the ERROR_DISPATCH case,
that checks if the response is already committed, and if so, abort
the transport - similar to what's already there for 9.4.
Introduced isAllowed(InetAddress, HttpServletRequest) so that it
would be possible to make access decisions also based on request
information such as context, path, headers, etc.
* Issue #586 Enhancement for detection of insufficient threads
Do not count acceptors and selectors at server level if connector uses own dedicated thread pool
Signed-off-by: vladimir.bukhtoyarov <jsecoder@mail.ru>
ConnectionFactories may be added after the connector is started.
As such there is always the possibility that creating a new
connection fails because there is no available ConnectionFactory for
that protocol.
Rather than failing with an IllegalStateException instead of a
NullPointerException, we now check at connector start whether the
SslConnectionFactory is properly configured.
This should catch 99% of the cases, where the connector is
misconfigured, reporting the error earlier and explicitly
(connector does not start) rather later and hidden (connection cannot
be created).
Now testing the return value of onEarlyEOF() and calling the
application when the value is true.
This means that the application can now consume the early EOF and the
spin does not happen.
* Issue #844 DoS Handler
First cut at implementation of Thread limiting handler for #844
* Added modules, simplified API, added IP exemptions
* fixed xml
* fixed preallocation
* simplified code
Added addCSV method to HttpFields to more efficiently add values to a CSV field without duplicates.
Improved usage of QuotedCSV and removed older parsing
Used new method in GazipHttpOutPutInterceptor to avoid duplicate Vary fields
If a request is not handled within the scope of the GzipHandler, the gzip interceptor is removed so it cannot be used by any subsequent handlers.
If the request is handled, it is left in place to be used by any async handling.
The new IPv6 capable InetAddressSet has been added as an alternative for IPAddressMap
The IncludeExclude class has been generalized to IncludeExcludeSet that can have a different
Predicate type to the set type and this works well with InetAddressSet.
However for #881 and #883, this may not be enough and Map semantics may need to be added.
The IPAccessHandler also has path mappings supported, which could need the map semantics, so for now a new InetAccessHandler has been
added that just uses an IncludeExcludeSet<InetAddressSet>, but this has yet to be tested.
The AbstractProxyServlet uses a host:port combinations, so IncludeExcludeSet<InetAddressSet> is not directly applicable.
* Issue #824 - Implement notifications of asynchronous error conditions for HTTP/2.
Introduced new method HttpChannelState.asyncError() to be called in
case of asynchronous errors, i.e. those errors that do not happen in
the HttpChannel.handle() loop.
Implemented HTTP/2 callbacks to call HttpChannelState.asyncError()
and plug in the existing error handling mechanism.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Issue #824 - Implement notifications of asynchronous error conditions for HTTP/2.
Improved implementation to ignore idle timeouts for streams and
session in case that requests are being handled, matching the HTTP/1.1
behavior.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
* Remove unused imports
Signed-off-by: arhimondr <andriyrosa@gmail.com>
* Improve HttpOtputTest
HttpOutputTest gives false positive results for couple of tests
(testAsyncWriteBufferLargeHEAD, testAsyncWriteBufferLarge). This happens
because only the tail of the response is being checked, and that fact that
the beginning of the response in not being sent is ignored.
For regular encoding responses it is easy to check that the entire content is
received by checking it with `response.endWith(expectedContent)`. However
for chunked responses extra parsing is required to check the content in such way.
For the sake of code simplicity only start and end of the response is being checked
for the chunked encoded responses.
Signed-off-by: arhimondr <andriyrosa@gmail.com>
* Add testAsyncWriteBufferLargeDirect test to HttpOutputTest
Just to verify that everything is right when sending native buffers
asynchronously instead of heap ones.
Signed-off-by: arhimondr <andriyrosa@gmail.com>
* HttpOtput: fix async write for heap ByteBuffer
Fix bug when asynchronous writes of Heap ByteBuffer were ignored.
ByteBuffer position was moved to the end in the constructor,
then in the `process` method `if (_buffer.hasRemaining())` condition
was always evaluated to `false` and the actual write was not performed.
Add assertion in `HttpOutputTest` to verify that after the asynchronous
write position of the buffer is always at the end.
Signed-off-by: arhimondr <andriyrosa@gmail.com>
Defined missing status codes (removed old/wrong javadoc)
Changed use of 413 to 431
Received SETTINGS_MAX_HEADER_LIST_SIZE is set on hpack encoded and warning generated only for large responses.