Commit Graph

1492 Commits

Author SHA1 Message Date
Lachlan 467052975e
improve testing of http2 client and refine default config (#10580)
* improve testing of http2 client and refine default config
* improve testing in HTTP2Test for hpack

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-09-27 09:57:06 +10:00
Joakim Erdfelt 896dee2466
Updating to version 10.0.17-SNAPSHOT 2023-08-25 14:27:38 -05:00
Joakim Erdfelt a2735a9ae9
Updating to version 10.0.16 2023-08-25 14:10:55 -05:00
Simone Bordet e91a68923a
Fixes #8926 - HttpClient GZIPContentDecoder should remove Content-Len… (#10326)
Now Content-Length and Content-Encoding are removed/modified by the decoder.
In this way, applications have a correct sets of headers to decide whether to decode the content themselves.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-08-21 08:58:22 +02:00
Simone Bordet b2477d1c38
Fixes #10160 - Verify PROXY_AUTHENTICATION is sent to forward proxies (#10162)
Now TunnelRequest.getURI() does not return null, so normalizeRequest() can properly apply the authentication headers.

Moved copy of a request to HttpRequest, so also the sub-type can be copied.
Fixed restore of destination in HttpProxy.HttpProxyClientConnectionFactory.newProxyConnection(): now doing it in the promise rather than in finally block.
Using the proxy destination (not the server's) to send subsequent CONNECT requests in case the first is not replied with 200.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-31 18:39:13 +02:00
Simone Bordet afef05a413 Fixes #9720 - Http2Session.streamIdleTimeout should permit being disabled
Now allowing to specify a negative value for AbstractHTTP2ServerConnectionFactory.streamIdleTimeout, while 0 implies to use the default value (from the EndPoint).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-31 17:17:01 +02:00
Simone Bordet 87c24e7258
Fixes #8405 - onAllDataRead() is called twice under h2 if the stream … (#10174)
* Fixes #8405 - onAllDataRead() is called twice under h2 if the stream times out

Per Servlet semantic, HTTP/2 stream timeout should be ignored.

The code was trying to fail the read via `_contentDemander.onTimeout()`, but
then it was still calling `onContentProducible()`, which was returning `true`
because the state of the read was IDLE (all the request content was read) and
the request was suspended.

Now the code checks if the read was really failed; if it is not, then
`onContentProducible()` is not called and so the idle timeout is ignored.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-31 15:13:50 +02:00
Simone Bordet a5a0a6c887
Fixes #10145 - WritePendingException over HTTP/2 tunnel (#10146)
Method HTTP2StreamEndPoint.flush() has a "no pending operation" semantic, but the previous implementation was calling stream.data(), which may become a pending operation if the stream is congested.

Changed the implementation of flush() to return false in the IDLE and PENDING cases.
Now every flush() is converted to a write(), which has the same semantic as stream.data().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-26 22:59:24 +02:00
Simone Bordet e997f48842
Added javadocs to HeaderParser.getFlags() and hasFlag().
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-07-15 15:29:06 +02:00
Jan Peter Stotz b0a9b7dc2d Missing flags getter added
Signed-off-by: Jan Peter Stotz <jpstotz@gmx.de>
2023-06-30 11:07:16 +02:00
Lachlan 6567a4478e
Merge pull request #9798 from eclipse/jetty-10.0.x-QPACK-encoding
review and cleanup of HTTP/3 QPACK Integer and String encoding
2023-05-29 16:43:05 +10:00
Simone Bordet 94c2649d7b
Fixed default table size for the HpackDecoder.
This is necessary because the remote encoder may encode fields assuming that the default size is 4096, and never send the table resize instruction.
In this case, the decoder table cannot start at zero, it must start at the default of 4096.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-28 00:38:43 +02:00
Simone Bordet 420ec7cc1d
HTTP/2 improvements. (#9749)
* Implemented a few required error handlings.
* Changed `Parser.init()` to directly take the listener, rather than wrapping it.
  The reason for this change was to be able to reconfigure the Parser upon receiving a SETTINGS frame.
* Initially setting the encoder and decoder max table capacity at the default of 4096, as per spec.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-27 19:14:01 +02:00
Ludovic Orban e30b23aca6 #9397 fix keystores with invalid Subject Alternate Names
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-05-26 23:09:24 +02:00
Lachlan Roberts dca4e9832e review and cleanup of HTTP/3 Integer and String encoding
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-25 23:09:24 +10:00
Lachlan Roberts 03d6afae91 Issue #9554 - rename NBitIntegerParser and NBitStringParser to decoders
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-04 09:31:20 +10:00
Lachlan Roberts 2d935efe4d Issue #9554 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-04 09:26:31 +10:00
Lachlan Roberts 6ad6dea1a2 fix test case
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-02 21:23:59 +10:00
Lachlan Roberts c2d2c1eadb Issue #9554 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-01 19:23:57 +10:00
Lachlan Roberts 1ee79f548c Issue #9554 - additional cleanups and testing
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-05-01 12:12:15 +10:00
Lachlan Roberts fa32199559 Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-10.0.x-9554-qpack-hpack 2023-04-28 16:25:34 +10:00
Lachlan Roberts a7b0b727dd Issue #9554 - add javadoc for huffman / n-bit integer classes and remove static decode methods
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-18 15:24:59 +10:00
Lachlan Roberts 09e6e6b211 Issue #9554 - add javadoc for illegal vchar methods and move to HttpTokens
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-18 10:46:29 +10:00
Lachlan Roberts c3b6b47915 Use ISO-8859-1 for encoding/decoding in huffman/hpack/qpack
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-17 17:11:14 +10:00
Lachlan Roberts b6d89af3ea Issue #9554 - fix test expectations for hpack
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-12 15:36:54 +10:00
Joakim Erdfelt ca3c1756ad
Updating to version 10.0.16-SNAPSHOT 2023-04-11 13:23:25 -05:00
Joakim Erdfelt 68017dbd00
Updating to version 10.0.15 2023-04-11 12:24:32 -05:00
Lachlan Roberts ebec7d2ea3 Issue #9554 - move common hpack/qpack code to jetty-http
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-04-11 16:51:37 +10:00
Olivier Lamy e62cc0344a Updating to version 10.0.15-SNAPSHOT 2023-03-01 18:55:10 +10:00
gregw 7a7d69a69f Happy no year
Remove modification date from copyright notice and instead just have the
project inception year.

Signed-off-by: gregw <gregw@webtide.com>
2023-02-15 15:22:32 +11:00
dependabot[bot] ca19b143a9
Bump maven.surefire.plugin.version from 3.0.0-M5 to 3.0.0-M8 (#9255) 2023-02-02 04:15:39 +00:00
Joakim Erdfelt 54c4c03244
Updating to version 10.0.14-SNAPSHOT 2022-12-07 14:33:17 -06:00
Joakim Erdfelt 1c2636ea05
Updating to version 10.0.13 2022-12-07 14:12:50 -06:00
Simone Bordet 7c757689a2
Fixes #9009 - Flaky test StreamCloseTest.testRequestDataClosedResponseDataClosedClosesStream.
Regression introduced by #8678.
Now using awaitility to wait for the stream count to go to zero.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-12-06 15:48:36 +01:00
Simone Bordet df265e0abb
Fixes #8678 - Jetty client receives GO_AWAY and continue to send traffic on same connection (#8891)
* Fixes #8678 - Jetty client receives GO_AWAY and continue to send traffic on same connection

* Now upon receiving the GOAWAY, the connection is removed from the pool, so it cannot be used by new requests.
* HTTP2Session.removeStream() now happens _after_ notifying HEADERS and DATA events, although the Stream state change still happens before.
This is necessary to avoid that a "close" event is notified before a "headers" or "data" event.

With these changes, the race window of a client acquiring a connection while the server is closing it is reduced, but it is impossible to close it completely.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-14 15:25:25 +01:00
Simone Bordet f21fa6e6e9
Fixed flakyness of GracefulShutdownTest by explicitly setting the Connector shutdownIdleTimeout to a large value that does not interfere with the tests.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-09 12:13:27 +01:00
Joakim Erdfelt cf7353f274
Jetty 10 - Improve test reliability (#8868)
* Don't care about stop failures in this test
* More consistent ConnectTimeoutTest
 + using IANA example.com (as it will route to a
   real machine, and will never have this
   specific port open)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-11-07 16:16:25 -06:00
Simone Bordet cd737489f9 Fixes #8811 - HTTP/2 session shutdown race may cause Server.stop() to block until stop timeout.
Now a completed future is returned from shutdown() if the session is already closed.

Moved the notification of the CompletableFuture to terminate(), which is always invoked.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-07 18:43:34 +01:00
Simone Bordet bff5b3eb8f
Code cleanup.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-03 21:56:38 +01:00
Gili Tzabari e2e59478ce Update in response to PR comments. 2022-10-24 13:17:25 -04:00
Olivier Lamy dbd07146ec
merge back release branch to bump version to 10.0.13-SNAPSHOT (#8593)
* Updating to version 10.0.12

* Updating to version 10.0.13-SNAPSHOT

* VERSION.TXT =+ content of jetty-9.4.49.v20220914 release

* remove strange line and reorder
2022-09-16 19:50:12 +10:00
Simone Bordet dab4fe60d3
Fixes #8558 - Idle timeout occurs on HTTP/2 with InputStreamResponseL… (#8585)
* Fixes #8558 - Idle timeout occurs on HTTP/2 with InputStreamResponseListener.

The issue was that HttpReceiverOverHTTP2.ContentNotifier.offer() was racy,
as a network thread could have offered a DATA frame, but not yet called
process() -- yet an application thread could have stolen the DATA frame
completed the response and started another response, causing the network
thread to interact with the wrong response.

The implementation has been changed so that HttpReceiverOverHTTP2.ContentNotifier
does not have a queue anymore and it demands DATA frames to the Stream
only when the application demands more -- a simpler model that just forwards
the demand.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-15 10:18:36 +02:00
Simone Bordet 77ad0189ba
Fixes #8532 - Review System.nanoTime() usages. (#8535)
* Fixes #8532 - Review System.nanoTime() usages.

Introduced o.e.j.util.NanoTime class to deal with nanoTimes.

Now NanoTime.now() should be used instead of System.nanoTime(),
and various <unit>[elapsed|since|until]() methods to calculate nanoTimes.

Furthermore, comparing 2 nanoTimes should be done via isBefore(),
rather than using the < operator, which is wrong as specified in
the System.nanoTime() javadocs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-06 09:30:02 +02:00
Greg Wilkins 2b817f06c6
Combined ByteBufferPool (#8171)
All `ByteBufferPool` can now be accessed as `RetainableByteBufferPools`.

Users now need to configure only a single buffer pool and there is just the additional retained parameter that needs consideration.
Default buffer pool has been changed to logarithmic, but we may wish to review that before next release.
Default factor size has been increased to 4096.
2022-07-04 10:38:30 +10:00
Lachlan 8e0ccad495
Merge pull request #8176 from eclipse/jetty-10.0.x-8170-WebSocketHttp2Close
Issue #8170 - fix WebSocket close over HTTP/2
2022-06-29 17:12:12 +10:00
Joakim Erdfelt 64d12e2a5a
Merge Release 10.0.11 back into `jetty-10.0.x` branch (#8194)
* Updating to version 10.0.11

* Updating to version 10.0.12-SNAPSHOT
2022-06-22 16:24:48 -05:00
Joakim Erdfelt c2bc103cb9
Merge Release 10.0.10 back into `jetty-10.0.x` (#8180)
* Updating to version 10.0.11-SNAPSHOT
2022-06-21 14:41:41 +02:00
Lachlan 1faa06179a
Issue #8170 - only fail stream if connection onIdleExpired returns true
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2022-06-17 17:56:17 +10:00
Lachlan Roberts e4b0db8666 Issue #8170 - fix WebSocket close over HTTP/2
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-06-17 15:28:16 +10:00
Greg Wilkins 7a1c165677
Implement #8057 103 Early Hint (#8058)
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2022-06-01 11:56:54 +10:00