Commit Graph

2824 Commits

Author SHA1 Message Date
Greg Wilkins 4dbf8a3a9e
Issue #4495 ReservedThreadExecutor optimise (#4499)
* Issue #4495 ReservedThreadExecutor optimise

Use synchronousQueue for task handoff

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4495 ReservedThreadExecutor optimise

updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4495 ReservedThreadExecutor optimise

Use a linked queue rather than a deque(as a stack).  This should be simpler, better optimised and less contended.  Idling has been simplified so that a reserve thread is always dropped every idle period.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4495 ReservedThreadExecutor optimise

reverted RTE and added a JMH benchmark

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* More variants and longer tests

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Added LQ

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* removed SQ2

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4495 ReservedThreadExecutor optimise

Replaced real implementation with SQ

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4495 RTE optimise

Removed alternate implementations

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4495 RTE optimise

updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-01-31 19:54:44 +01:00
Joakim Erdfelt 56fc476d55 Updating to version 9.4.27-SNAPSHOT 2020-01-17 07:00:10 -06:00
Joakim Erdfelt 7b38981d25 Updating to version 9.4.26.v20200117 2020-01-17 06:21:47 -06:00
Joakim Erdfelt 19e91a6a40
Issue #4483 - Cleanup of InetAddressSetTest (#4484)
* More resiliency on bad DNS servers

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-01-16 14:05:11 -06:00
Joakim Erdfelt 8c65309963
Addressing Checkstyle violations in src/test/java
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-01-14 12:33:34 -06:00
Simone Bordet 923ec38adf Merged branch 'jetty-9.3.x' into 'jetty-9.4.x'. 2020-01-07 16:51:25 +01:00
Simone Bordet e3c8546667 Merged branch 'jetty-9.2.x' into 'jetty-9.3.x'. 2020-01-07 16:35:05 +01:00
Simone Bordet de890bb1b7 Happy New Year 2020.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-01-07 16:25:32 +01:00
Joakim Erdfelt f4e7e4c3db Merge branch 'release-9.4.25' into jetty-9.4.x 2020-01-03 12:49:27 -06:00
olivier lamy e1371a1c13 happy new year
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-01-02 21:54:05 +01:00
Joakim Erdfelt 8974176c4b Updating to version 9.4.26-SNAPSHOT 2019-12-20 11:30:41 -06:00
Joakim Erdfelt a9729c7e7f Updating to version 9.4.25.v20191220 2019-12-20 10:46:56 -06:00
Jesse Glick bc338e7c88
Reduce log level of message
Signed-off-by: Jesse Glick <jglick@cloudbees.com>
2019-12-19 15:43:19 -05:00
Simone Bordet 26b0445a9e Fixed visibility of Scanner.Visitor.
Must be package private because it uses TimeNSize
in method signatures, that is also package private.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-12-19 11:53:20 +01:00
Greg Wilkins c5acf96506
Jetty 9.4.x 4331 async close complete3 (#4409)
* Issue #4376 Async Content Complete

Added test harness to reproduce unready completing write.
Fixed test by not closing output prior to becoming READY

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Async Write Complete

Test harness to reproduce unready when closing/completing.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Async Write Complete

test both PENDING and UNREADY

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Async Write Complete

test cleanups

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Async Close Complete

Cleanups of write

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* WIP

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Work in progress

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Added async close to HttpWriter and ResponseWriter
Always use async close, with blocker if necessary.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Working async close complete!

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

invert test as we can now call complete when not ready!

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

fixed transition to ERROR state

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

async close after onError

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

minor cleanups

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Fix for proxy tests

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Fix write loop to handle clear of p=0,l=0 rather than p=l

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Removed old close on all content mechanism
Cleanups and some more TODOs

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

a reworking of HttpOutput to separate out API state.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Soft close for Dispatcher
release buffer in onWriteComplete

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Set _onError in onWriteComplete
NOOP callback instead of null

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

failure closes HttpOutput

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Moved closedCallback handling to onWriteComplete

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Additional test of complete during blocking write.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

reimplemented blocking close to sometimes be async

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

ascii "art"

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Code cleanup.  Use a CLOSE state rather than non null closedCallback to be clearer that it is a state.
Renamed close(Callback) to complete(Callback)
Renamed and simplified closed() to completed()

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Do not dispatch
Better ascii art
improved close impl to be similar to complete

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

More test cases

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

retain execute behaviour in 9.4. review in 10.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Improved javadoc and ascii art

* Improved CLOSING

Switch to CLOSING state as soon as last write is done, even if several non last channelWrites will be done.   This allows a subsequent call to close to know that nothing needs to be written and can avoid some EOF exceptions. Now onWriteComplete acts only on the passed in last parameter.

Added test for sendContent

* WIP

Aggregate within lock
pipeline test debug

* Avoid creating ignored exception when Idle or Failed.

* Try a parse without fill to avoid unconsumed input debug

* fixed pipeline size

* release buffer before callback

* turn off debug

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Better javadoc
refactored onWriteComplete logic to be simpler
fixed bug with flush of last written byte

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Completely reworked test harness for better coverage.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4331 Close Complete

Reworked order of ifs to match logic above in onWriteComplete

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-12-19 12:17:11 +11:00
Joakim Erdfelt 53073ca257
Issue #4385 - Reverting WARN log in favor of IllegalStateException
+ Plus fleshing out the testcases more for Base / Client / Server
  with and without certificates that will trigger SNI requirement
  and ISE.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-12-06 13:20:24 -06:00
Joakim Erdfelt d1376c71eb
Issue #4385 - Correcting exception variable name.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-12-02 16:02:18 -06:00
Joakim Erdfelt 65738e770f
Issue #4385 - Fixing client testcase assertion
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-12-02 16:00:37 -06:00
Joakim Erdfelt 5b1f9d5f15
Issue #4385 - Client no longer needs override.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-12-02 12:15:02 -06:00
Joakim Erdfelt 816e34bddf
Issue #4385 - Base Class usage now is a WARN logging event in SNI usage
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-12-02 12:13:13 -06:00
Joakim Erdfelt e1d64af578
Issue #4385 - Minimize impact of deprecated SNI mode on base class
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-12-02 12:00:21 -06:00
Joakim Erdfelt 666ee4ef60
Issue #4385 - Remove UnsupportedOperationException in SslContextFactory
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-12-02 10:57:15 -06:00
Jan Bartel cfd21864cf
Issue #4350 Remove exclude of MultiInputStreamParser from jetty-util osgi (#4356)
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-11-27 11:45:33 +11:00
Joakim Erdfelt 5d7f7d6499 Merge branch 'release-9.4.24' into jetty-9.4.x 2019-11-26 10:31:28 -06:00
Lachlan Roberts 668cd86283 Issue #995 - UrlEncoded.encodeString should not encode unreserved chars
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-11-22 17:50:28 +11:00
Joakim Erdfelt 0f7a3b2d91 Updating to version 9.4.25-SNAPSHOT 2019-11-20 16:08:38 -06:00
Joakim Erdfelt 363d5f2df3 Updating to version 9.4.24.v20191120 2019-11-20 15:25:01 -06:00
Joakim Erdfelt 87eefa344a
Fixes #3083 - Aligning default in ini to XML default
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-20 09:54:24 -06:00
Joakim Erdfelt 453d41940b Updating to version 9.4.24-SNAPSHOT 2019-11-18 13:52:51 -06:00
Joakim Erdfelt abbccc65d6 Updating to version 9.4.23.v20191118 2019-11-18 13:09:44 -06:00
Joakim Erdfelt f4d387e0d6
Issue #4325 - X509ExtendedKeyManager exceptions on non-Server SSL
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-18 12:13:05 -06:00
Joakim Erdfelt 55ad1074bd
Issue #4325 - X509ExtendedKeyManager exceptions on non-Server SSL
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-18 10:58:12 -06:00
Joakim Erdfelt 3def3415ed
Merge pull request #4289 from eclipse/jetty-9.4.x-4287-move-getUriLastPathSegment
Issue #4287 - Move getUriLastPathSegment() to URIUtil
2019-11-12 14:51:23 -06:00
Greg Wilkins ee0f9fc1d0
Issue #4033 Percent Encoded Bad Requests (#4272)
* Modernizing testcase

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 Percent Encoded Bad Requests

Added test to demonstrate bad percent encoded request

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4033 - adding sanity test for percent paths and checkAlias()

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Eliminating 9.3.0.RC0 dependency

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 - More tests for Resource checkAlias() behavior

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 - Splitting badDecodePath

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 - More badDecodePath tests

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

* Issue #4033 Percent Encoded Bad Requests

reverted decodePathBehaviour

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* testing pull request building

* Issue #4033

updates after review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-11 12:01:26 +11:00
Joakim Erdfelt 4ab910bdc0
Issue #4287 - Move getUriLastPathSegment() to URIUtil
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-07 15:52:00 -06:00
Joakim Erdfelt cc289980cf
Merge pull request #4268 from eclipse/jetty-9.4.x-4173-NPE-WebInfConfiguration
Issue #4173 Avoid NPE generating name of tmp dir in WebInfConfiguration
2019-11-07 14:49:20 -06:00
Joakim Erdfelt 64a916e6ec
Issue #4173 - use JarFileResource's Jar java.io.File object if present
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-07 05:11:48 -06:00
Joakim Erdfelt 13a574557b
JarFileResource.getFile() now returns the Jar's java.io.File object
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-11-06 16:09:54 -06:00
Jan Bartel aefbdfca58
Issue #2266 Rework Scanner and use it for Jetty Maven Plugin (#4239)
* Issue #2266 Rework Scanner and use it for Jetty Maven Plugin

Signed-off-by: Jan Bartel <janb@webtide.com>
2019-11-06 15:55:20 +11:00
Joakim Erdfelt 43d95cd984 Updating to version 9.3.29-SNAPSHOT 2019-11-05 13:02:10 -06:00
Joakim Erdfelt d7dd68d6e9 Updating to version 9.3.28.v20191105 2019-11-05 11:46:40 -06:00
Joakim Erdfelt b17439c731 Updating to version 9.2.30-SNAPSHOT 2019-11-05 11:23:21 -06:00
Joakim Erdfelt 36c95fdd43 Updating to version 9.2.29.v20191105 2019-11-05 10:43:15 -06:00
Simone Bordet e09444eeb5 Issue #3863 - Enforce use of SNI (#4085)
* Issue #3863 -  Enforce use of SNI.

Introduced SslContextFactory.rejectUnmatchedSNIHost (default false)
so that if no SNI is sent, or SNI does not match a certificate,
then the TLS handshake is aborted.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* Issue #3863 - Enforce use of SNI.

Updates after review.
Introduced SslContextFactory.SNISelector to allow application to write
their custom logic to select a certificate based on SNI information.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>

* Issue #3863 Enforce SNI

Added two sniRequired fields - one at SslContextLevel and the other at the SecureRequestCustomizer.  This allows rejection either at TLS handshake or by 400 response.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3863 Enforce SNI

cleanups from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3863 Enforce SNI

improved comments

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3863 Enforce SNI

syntax sugar

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3863 SNI

Updates from review.  Extra test for sniSelector function

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-05 09:07:34 +11:00
Joakim Erdfelt 1ed13b6b30 Updating to version 9.4.23-SNAPSHOT 2019-10-22 09:19:41 -05:00
Joakim Erdfelt b1e6b55512 Updating to version 9.4.22.v20191022 2019-10-22 08:20:50 -05:00
Simone Bordet dc59addb6f Code cleanup.
Made method reportDifferences(...) private since it was exposing
package private class TimeNSize and no code outside of jetty-util
could have used it.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-20 16:50:31 +02:00
Simone Bordet 95b205aa34 Class InetPattern is package private, so made nnewInetRange(String)
private because no code outside jetty-util could call that method.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-20 16:18:58 +02:00
Simone Bordet 92bfcb6c73 Class Managed is package private, so made addBean(Object, Managed)
private because no code outside of jetty-util could call that method.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-10-20 16:10:01 +02:00
Greg Wilkins 3d19f61122
Issue #4193 - Fix InetAccess port control (#4206)
* issue exclude/include con name InetAccesHandler - add better unit test

this logic:

        String name =
baseRequest.getHttpChannel().getConnector().getName();
        return _names.test(name) && _addrs.test(addr);

Is not correct. it's treating the connector name exactly like the
filter. But that's not what it's intended to do. It's supposed to tell
what connectors are applicable to this filter. And what connectors are
not affected.

For example in the unit test there exists 2 connectors:

http
tls

We want to restrict the http connector, but we want to leave tls
connector alone.

So we would specify:

include = 192.168.1.1-192.168.1.254
includeConnector = http

The way the logic is above, it is treating the connector name as if it's
the filter itself. Which is not what I intended.

What i need in psuedo-code is this:


   if (there are no "include connectors" OR if this connector is
included) AND (if this connector is not in the excluded list)
     ---> Then apply the IP filter.

Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>

* exclude should take precedence over include

Signed-off-by: Nicholas DiPiazza <nicholas.dipiazza@lucidworks.com>

* Issue #4193 InetAccessHandler

reverted changes to IncludeExcludeSet

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4193 InetAccessHandler

updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-10-18 09:03:28 +11:00