* 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.
+ Jetty 9.2 (and earlier) used a Resource.getInputStream() implementation
that would trigger an IOException on-construction (vs on-first-access)
due its use of java.io.FileInputStream(File) which had a isDirectory
check in its constructor.
+ Jetty 9.3 and onward uses java.nio.file.Files.newInputStream() which
has the bad on-first-access behavior.
+ Changing the behavior of PathResource.getInputStream() to behave the
same way as the prior FileResource.getInputStream(), as well as adding
the Resource.isDirectory() check back into ContextHandler.getResourceAsStream(String)
to prevent creation of the InputStream in the first place.