Fixed race condition where the prime request response was arriving to
the client before the server had finished to clean up and remove the
prime stream. Subsequent client requests were rejected because the
prime stream was still "alive".
* 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>
Using https scheme in CONNECT request if the proxy is secure.
A Proxy must not match its own address.
Resolved correctly request URI in case of CONNECT requests.
* 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>