Commit Graph

2427 Commits

Author SHA1 Message Date
Simone Bordet 158a57276e Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-08-18 12:22:44 +02:00
Simone Bordet 0646e4d0b5 Fixes #5165 - Wrong messagesIn count for HttpClient.
Now incrementing inMessages only when the response is complete.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-18 11:41:18 +02:00
Simone Bordet 7bc52f924a Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-08-14 18:34:46 +02:00
Simone Bordet a6e1f9df8f
Merge pull request #5151 from olegmoz/5150-zero-connection-timeout
Issue #5150 - Infinite connection timeout support in ManagedSelector
2020-08-14 18:32:52 +02:00
Oleg Mozzhechkov 32fe19a5e0 #5150 - Code style fix and connect timeout docs update
Signed-off-by: Oleg Mozzhechkov <oleg.mozzhechkov@gmail.com>
2020-08-13 21:23:31 +03:00
Simone Bordet e5570639e3 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-08-13 19:40:34 +02:00
Simone Bordet edbc1930b9 Issue #4809 - Set a max number of requests per connection.
Added test case for idle connections not used for any request.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-13 19:39:27 +02:00
Simone Bordet ae713d65d9 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-08-12 16:17:06 +02:00
Simone Bordet 4a0af046b8 Closes #4809 - Set a max number of requests per connection.
Implemented as part of #4975.

Added a test case that proves that the connection is closed
when the max usage count is reached.

Improved logging.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-12 16:14:51 +02:00
gregw cd42fd1635 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: gregw <gregw@webtide.com>
2020-08-12 11:42:36 +02:00
Greg Wilkins 25e3f1c1e0
Pool class refinements (#5117)
* Some updates to the new Pool class:

 + fixed a race with pending reservations
 + use a pending counter
 + Reservation API to simplify Entry API
 + removed public methods on Entry API

* Some updates to the new Pool class:

 + fixed a race with pending reservations
 + use a pending counter
 + Reservation API to simplify Entry API
 + removed public methods on Entry API

* Updates from review

* Updates from review
Tests for cache size and acquire with creator

* Method no longer required with Reservation

* update from the feedback on the feedback of the feedback from the review.

Moved enable to Entry, removed Reservation class and clarified usage in javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

fixed javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

fixed javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

fixed javadoc

* Issue #5095 XmlConfiguration locking  Use pool instead of static shared instance

updates from review
2020-08-12 11:27:25 +02:00
olivier lamy 2522857a5a make this public to avoid jpms issue...
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-08-12 14:45:55 +08:00
Simone Bordet 16cd552995 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-08-11 21:00:43 +02:00
Simone Bordet 2e73f80d34 Fixes #5079 - :authority header for IPv6 address not having square brackets.
Reverted code changes to HttpClient.normalizeHost().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-11 20:03:42 +02:00
Simone Bordet 897e766f24 Fixes #5079 - :authority header for IPv6 address not having square brackets.
Updates after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-11 19:18:11 +02:00
olivier lamy c198d26e6b Updating to version 10.0.0-SNAPSHOT 2020-08-11 16:47:55 +08:00
olivier lamy 429b091578 Updating to version 10.0.0.beta1 2020-08-11 16:47:54 +08:00
Simone Bordet d53d9d8a1d Fixes #5079 - :authority header for IPv6 address not having square brackets.
On the client:
* Origin.Address.host is passed through HostPort.normalizeHost(),
so that if it is IPv6 is bracketed.
Now the ipv6 address passed to an `HttClient` request is bracketed.
* HttpRequest was de-bracketing the host, but now it does not anymore.

On the server:
* Request.getLocalAddr(), getLocalName(), getRemoteAddr(),
getRemoteHost(), getServerName(), when dealing with an IPv6 address,
return it bracketed.
The reason to return bracketed IPv6 also from *Addr() methods is that
if it is used with InetAddress/InetSocketAddress it still works, but
often it is interpreted as a URI host so brackets are necessary.
* DoSFilter was blindly bracketing - now it does not.

Added a number of test cases, and fixed those that expected
non-bracketed IPv6.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-07 15:53:19 +02:00
Simone Bordet 1f14dfa427 Code cleanups.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-06 11:23:48 +02:00
Simone Bordet c49035570e Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-convert_synchronized_to_autolock'. 2020-08-04 16:32:55 +02:00
Simone Bordet 55f51fa0b5 Fixed copyright headers.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-31 19:01:59 +02:00
Simone Bordet 2fe01626a5 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-07-31 17:47:37 +02:00
Ludovic Orban e9dad975e6 Re-implement HTTP connection pooling with a non-queuing algorithm
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-07-31 10:36:43 +02:00
Simone Bordet 089e51f0bc Fixes #5083 - Convert synchronized usages to AutoLock.
Updates after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-29 15:34:01 +02:00
Simone Bordet 8d69fc41a7 Fixes #5083 - Convert synchronized usages to AutoLock.
* Replaced relevant usages of synchronized with AutoLock.
* Made AutoLock serializable since classes that use it may be stored in the HttpSession.
* Added convenience methods to AutoLock to execute lambdas with the lock held.
* Introduced AutoLock.WithCondition to use a Lock and a Condition together.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-27 23:14:05 +02:00
Simone Bordet a33b0e290e Avoid using a protected Logger instance.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-27 16:05:03 +02:00
Joakim Erdfelt fe9deae849 Updating to version 9.4.32-SNAPSHOT 2020-07-23 13:53:47 -05:00
Joakim Erdfelt 450ba27947 Updating to version 9.4.31.v20200723 2020-07-23 12:46:54 -05:00
gregw 965e73e9e9 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-07-20 12:01:53 +02:00
gregw 88ec429b9c Issue #5053
removed weak random from digest.
2020-07-17 13:02:46 +02:00
gregw f6d39849e8 Improves #5053 by giving option of secure or pseudo random
Allow random to be passed in and can default to a weak pseudo random.
2020-07-17 12:19:22 +02:00
Greg Wilkins beca81c990
Fixes #5053 CWE-331 (#5056)
Replace uses of Random with SecureRandom.
We do not believe any of these uses of Random represent any security vulnerability, but we are making this
change for an abundance of caution and to avoid warnings from 3rd party scanning tools.
2020-07-16 15:31:19 +02:00
Lachlan Roberts c09e4d6f86 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-16 08:46:29 +10:00
Lachlan Roberts de1b6745c5 the DO NOT EDIT comment in .mod files should start with '#'
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-15 16:47:22 +10:00
Simone Bordet 7b05567b52 Issue #4808 - Review HttpClient Request header APIs.
For some reason, Request.getHeaders() returned HttpFields,
but HttpRequest.getHeaders() returned HttpFields.Mutable,
and it was obviously wrong.

Fixed WebSocket code that was relying on this API error.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-13 16:44:07 +02:00
olivier lamy eefe3d202b revert fail release
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-07-10 15:04:22 +10:00
olivier lamy 9619a5a743 Updating to version 10.0.0.beta1 2020-07-10 14:23:28 +10:00
Simone Bordet 113595254b Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-07-09 16:19:24 +02:00
Simone Bordet 94956d6e8b Issue #4904 - WebsocketClient creates more connections than needed.
Fixed MaxConcurrentStreamsTest - it was always broken.
The problem was that the call to super.onSettings(...) was done
_after_ sending the request, so the connection pool was still
configured with the default maxMultiplex=1024.

Also fixed AbstractConnectionPool to avoid a second call to
activate() if we are not trying to create a new connection.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-09 16:18:15 +02:00
Simone Bordet d31bbb2195 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-07-09 13:30:15 +02:00
Simone Bordet 6844c9362d Issue #4904 - WebsocketClient creates more connections than needed.
Fixed MultiplexConnectionPool.acquire() to use the new boolean
parameter to decide whether or not create a new connection.

This fixes ConnectionPoolTest instability.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-09 13:27:44 +02:00
olivier lamy aaeffb719e Updating to version 10.0.0-SNAPSHOT 2020-07-09 12:25:34 +10:00
olivier lamy 23c99ffdbe Updating to version 10.0.0.beta1 2020-07-09 11:20:55 +10:00
Simone Bordet 42d5db3208 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-07-03 10:46:24 +02:00
Simone Bordet e0955192b8
Jetty 9.4.x 4976 httpclient fix null network buffer (#5010)
Fixes #4976  HttpClient async content throws NPE in DEBUG log.

Reworked handling of asynchronous content by immediately exiting
HttpReceiverOverHTTP.process(), so that there is no race with
other threads that have been scheduled to resume the processing.

The call to HttpReceiver.dispose() that could be triggered by
an asynchronous failure is now performed either by the failing
thread (if the HttpReceiver is not processing) or by an I/O
thread (if the HttpReceiver is processing) similarly to what
happens when terminating the response.

The content decoding has been reworked to perform the required
state changes similarly to what non-decoded content is doing,
as this was completely lacking before (it was actually a side
bug that is now fixed).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2020-07-03 09:30:15 +02:00
Joakim Erdfelt 6df6fa33b8 Updating to version 9.4.31-SNAPSHOT 2020-06-11 08:24:34 -05:00
Joakim Erdfelt 271836e4c1 Updating to version 9.4.30.v20200611 2020-06-11 07:21:18 -05:00
Simone Bordet 5308adab60 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-06-01 22:02:59 +02:00
Simone Bordet 88a139628f
Merge pull request #4930 from eclipse/jetty-9.4.x-4929-request_cookies_not_sent_when_cookiestore_empty
Fixes #4929 - HttpClient: HttpCookieStore.Empty prevents sending cook…
2020-06-01 21:55:56 +02:00
Simone Bordet b8b88b238e Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-06-01 17:24:36 +02:00