Commit Graph

2604 Commits

Author SHA1 Message Date
Simone Bordet fe505766fd
Fixes #9501 - jetty client with proxy Connection: close (#9508)
Now Connection: close is ignored for 2xx responses to a CONNECT method.
In this way the tunnel is kept open, and bad proxies that were sending
Connection: close are now supported as apparently they are still out there.

Fixes also #6483.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-20 10:09:58 +01:00
Joakim Erdfelt 10a374aeb5
Disable test no longer functional on OpenJDK 11.0.18+
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2023-03-01 13:50:10 -06: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 f122e75dd6
Reduced test load and increased timeout to avoid flakyness in Jenkins.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-12-06 14:29:51 +01:00
Simone Bordet 1a1b9cfe4c
Fixes #8770 - Review whether to send request body in redirects. (#8775)
* Fixes #8770 - Review whether to send request body in redirects.

Now the original request body is re-sent only if the redirect status code is 307 or 308.
In the other cases, it is a redirect to a GET method, so the Location is followed without resending the body, and the content headers are removed.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-08 21:54:20 +01:00
Simone Bordet 35af8e5c71
Fixed tests that fail when localhost resolves to more than one address.
On Windows, Mac, OpenSolaris (verified) and probably Docker (did not verify, but likely),
DNS resolution of "localhost" yields [127.0.0.1, ::1], while on Linux only [127.0.0.1].

HttpClient will try the first address, and in case of failure will try the second address.
For those tests that want to explicitly fail the connection attempt, we don't want them to
try the second address, which likely yields test failures because of unexpected results
(for example, a different exception type).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-28 13:33:28 +02:00
Simone Bordet 5973ce2941
Small additional fixes.
* Removed "since" attribute (it's commonly related to Java versions) to avoid confusion.
* Avoid using getProxies() to modify the Proxy object in ProxyServletTest.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-25 09:52:55 +02:00
Gili Tzabari e2e59478ce Update in response to PR comments. 2022-10-24 13:17:25 -04:00
Gili Tzabari 48b89bdc2a Fixing checkstyle errors. 2022-10-24 13:04:14 -04:00
Gili Tzabari d50510a1fe Fixes #8723: Provide a thread-safe way to modify HttpClient proxies at runtime. 2022-10-24 13:04:14 -04:00
Jan Vojt 1f8b0c75a4 Issue #8753 - Fix HttpClient initialization with destinationIdleTimeout set.
Signed-off-by: Jan Vojt <jan@vojt.net>
2022-10-21 15:45:46 +02:00
Gili Tzabari 481c801c3c
Jetty 10 - #8591: Indicate units of HttpClient properties (#8728)
* Fixes #8591: Indicate units of HttpClient properties.
2022-10-19 18:34:34 +02:00
Simone Bordet ecea0e6d0a
Fixes #7993 - HttpClient idleTimeout configuration being ignored/over… (#8672)
* Fixes #7993 - HttpClient idleTimeout configuration being ignored/overridden

The problem was that the timeout scheduling was not happening,
because for TunnelRequest the timeouts were set in normalizeRequest(),
which runs after the scheduling.

Now a call to request.sent() is made also after normalizeRequest()
so that the timeouts is scheduled (if it was not scheduled before).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-05 11:46:00 +02:00
Simone Bordet 58f0e0744b Fixes #8584 - HttpRequest.send() never returns
Fixed handling of the idle timeout in case the SOCKS proxy does not reply to the SOCKS bytes.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-05 11:45:13 +02:00
Simone Bordet 39bf8ff24d
Fixes #8623 - Use AutoLock in InputStreamResponseListener.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-27 12:39:20 +02: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 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
Ludovic Orban de13ceff36 Fixes #8493: RemoveIdleDestinations's race condition and improve logging.
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-09-01 14:45:41 +02:00
Ludovic Orban 50b7dc4bbc #8188: fix test flakiness by using a thread-safe collection to track leaded buffers
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-10 10:35:34 +02:00
Ludovic Orban 7b57307c71 #8188: fix test flakiness by handling null buffers returned by the pool
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-08-10 10:35:34 +02:00
Marc Philipp 4a6c2744a0 Grow request queue instead of pre-allocating it
To avoid excess allocation, in particular for higher values of
`MaxRequestsQueuedPerDestination`, the per-destination request queue is
now initialized with a capacity of 32 entries and configured to grow 32
entries at a time until the maximum is reached.

Resolves #8319.
2022-07-28 19:07:36 +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
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
Ludovic Orban 66de7ba618
Improve ssl buffers handling (#8165)
* Fixes #8161 improve SSLConnection buffers handling

Added memory heuristic to ArrayRetainableByteBufferPool

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-06-15 15:10:50 +02:00
Simone Bordet e9262ce26c
Fixes #7994 - Ability to construct a detached client Request (#8103)
Implemented copy of the request tag that was mistakenly missing.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-06-03 09:27:10 +02: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
Simone Bordet d1e64f4693
Fixes #8014 - Review HttpRequest URI construction. (#8015)
Fixes #8014 - Review HttpRequest URI construction.

Now always adding a "/" before the path, if not already present.
Disabled flakey HTTP/3 test.
Parse CONNECT URIs as Authority

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2022-05-26 18:13:17 +10:00
Greg Wilkins f1c2b0d0e2
Improve #8051 (#8052)
Increased test timeouts
2022-05-24 19:09:00 +10:00
Joakim Erdfelt 16420f0181
Set version to `10.0.10-SNAPSHOT` (#7823)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-04-03 20:33:44 +10:00
Joakim Erdfelt f079949a35
Merge Release 10.0.9 (#7821)
* Updating to version 10.0.9

* Updating to version 10.0.10
2022-04-02 08:43:44 -05:00
Simone Bordet 454cb19bf5
Fixes #7575 - Misleading docs for HttpClientTransportDynamic (#7800)
Improved documentation for the clear-text dynamic transport case.
Fixed HttpClientTransportDynamic javadocs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-03-29 12:00:18 +02:00
Ludovic Orban a6cd037923 #7461 Adapt other tests to use less strict assertion for expiring pool
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-02-14 12:33:18 +01:00
Ludovic Orban 4382bc122e #7461 Use less strict assertion for expiring pool to account for potential expirations
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-02-14 12:33:18 +01:00
Kaiyue Zhou d67fc16a48 Fix typo: "application/octect-stream" -> "application/octet-stream" 2022-02-08 13:01:25 +08:00
Simone Bordet a4fda96f49
Updating to version 10.0.9-SNAPSHOT 2022-02-07 12:02:02 +01:00
Simone Bordet 716c7afd8e
Updating to version 10.0.8 2022-02-07 11:34:12 +01:00
Joakim Erdfelt cb127793e5
Happy New Year 2022 (#7459)
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-01-27 10:42:30 -06:00
Ludovic Orban 25306366d4 #7201 improve efforts to call listeners only when needed and guard against potential concurrent closures
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-01-18 09:54:18 +01:00
Ludovic Orban fdeb03d556 #7201 try to call released() and removed() listeners when the connection pool gets closed
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-01-18 09:54:18 +01:00
Simone Bordet 3042f2b2bf
Fixes #7348 - Slow CONNECT request causes NPE (#7349) (#7352)
* Fixes #7348 - Slow CONNECT request causes NPE (#7349)

Added NPE guard in `HttpReceiverOverHTTP.onUpgradeFrom()`.
Expanded logic in `HttpReceiverOverHTTP.parse()` to return true in case of CONNECT + 200.

Fixed `ProxyConnection.toConnectionString()` to avoid NPEs.

Fixed `HttpClientTest.testCONNECTWithHTTP10()` logic
after changes to fix this issue.

Now a tunneled connection is not put back into the connection pool,
and if applications explicitly want to use it, they must re-enable
fill interest, similarly to what should be done after upgrade+101.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
(cherry picked from commit 5eb7b70df7)
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-01-06 11:08:12 +01:00
Simone Bordet 94c3e9a775 Issue #6728 - QUIC and HTTP/3
Removed obsolete TODO comment.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00
Simone Bordet b19c135f46 Issue #6728 - QUIC and HTTP/3
- Fixed max streams semantic for HTTP/3.
It's not *concurrent* streams but *cumulative* streams that are limited.
Fixed MultiplexConnectionPool to take that into account with the introduction
of ConnectionPool.MaxUsable.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00
Simone Bordet baab1a15b9 Issue #6728 - QUIC and HTTP/3
- More fixes and improvement to HTTP client transport tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00
Simone Bordet 40aba07e33 Issue #6728 - QUIC and HTTP/3
- More work on making HTTP semantic layer work on top of HTTP/3.
- Various fixes and improvement to HTTP client transport tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00
Simone Bordet 3585b408b7 Issue #6728 - QUIC and HTTP/3
- Made sure Connection.Listeners are properly notified.
- Fixed removal of QuicStreamEndPoints from QuicSession in case of successful request/response exchanges.
- Avoid spurious wakeups by shutting down input after receiving a frame with last=true.
- Updated HttpClient transport tests to work with UNIX_DOMAIN.
- Started updating HttpClient transport tests to work with HTTP/3.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00