* 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.