Commit Graph

4922 Commits

Author SHA1 Message Date
Greg Wilkins 81c46638cd
Jetty 10.0.x 4814 configuring connection factory (#4815)
* Issue #4814 Configuring Connection Factory

Redo of this PR without Attributes improvements (moved to #4816).
Add a ConnectionFactory.Configuring interface to all connectors to be configured during doStart.
I have some concern about shared HttpConfigurations.

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

* updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-04-29 11:45:08 +02:00
Greg Wilkins 8c7e34f37d
Jetty 10.0.x immutable meta data (#4777)
Made HttpURI, HttpFields and MetaData immutable.  The first two follow the same builder pattern and MetaData is constructor injection only.

* Immutable version of HttpFields

Preserve API and usage of HttpFields class while providing a read only interface and immutable implementation.

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

* Immutable version of HttpFields

Use an ArrayList in HttpFields. While slightly slower than the array, it will mostly be used as a builder pattern for an Immutable

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

* Immutable version of HttpFields

Fixed exception type.

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

* Immutable version of HttpFields

asImmutable method

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

* Immutable MetaData

Made HttpURIU immutable with a builder pattern.
MetaData immutable and working within http module.

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

* Immutable MetaData

Fixes from review

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

* Immutable MetaData

Passing tests upto and including jetty-server

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

* Immutable MetaData

Cleanup of HttpURI.Builder API as suggested in PR.

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

* Immutable MetaData

Added builder for MetaData.Request

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

* Immutable MetaData

more api fixes

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

* Immutable MetaData

WIP making HttpFiels itself immutable.  Currently working up to jetty-servlet.

Need to consider if content-length really is meta data and how much and when can we trust it.

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

* Immutable MetaData

WIP

Need to consider if content-length really is meta data and how much and when can we trust it. Also need to consider difference between h2 and h1 authority in metadata.

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

* Immutable MetaData WIP

jetty-client and jetty-servlet passing tests.

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

* Immutable MetaData WIP

Better align the style of immutability between `HttpFields` and `HttpURI`.
They both now have static build() and from() methods, plus Builder and Immutable implementations.
Potentially `Builder` could be renamed as `Mutable`

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

* Immutable MetaData WIP

http2-server tests passed

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

* Immutable MetaData WIP

http2-client tests passed

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

* Immutable MetaData WIP

cleann build?

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

* Immutable MetaData WIP

fix

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

* Immutable MetaData WIP

more test fixes

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

* Immutable MetaData WIP

Cleanups, mostly using EMPTY when appropriate.

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

* Immutable MetaData WIP

Cleanups, use immutable

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

* Immutable MetaData WIP

No trailers for connect

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

* Immutable MetaData WIP

Fix CONNECT path handling

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

* Immutable MetaData WIP

fixed rewrite query handling

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

* Immutable MetaData WIP

rename Builders to Muttables

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

* Immutable MetaData WIP

misc cleanups

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

* Immutable MetaData WIP

Revert to using arrays due to garbage generated by streams and iterators (12% of a simple benchmark!).
Even if this garbage is an artifact of the JIT being disabled by observation, it can hide other allocations, so best to just use simple arrays!

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

* Immutable MetaData WIP

More optimizations and better test coverage.

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

* Immutable Metadata

various cleanups

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

* Immutable MetaData WIP

More optimizations

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

* Immutable MetaData WIP

review changes

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

* Immutable MetaData WIP

changes after review:
 + less usage of Mutable
 + more usage of EMPTY
 + restored fragment handling

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

* Immutable MetaData WIP

changes after review:
 + less usage of Mutable
 + less usage of asImmutable

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

* Immutable MetaData WIP

changes after review:
 + less usage of Mutable

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

* Immutable MetaData

changes after review:
 + better handling of URI in ContextHandler

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

* Immutable MetaData

changes after review:
 + downcast in test to access mutable response headers.

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

* Immutable MetaData

changes after review:
 + use put instead of add for one time headers

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

* private

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-04-28 13:36:44 +02:00
Greg Wilkins ef4d1fac04 fixed bad merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-04-28 10:52:02 +02:00
Greg Wilkins eacb79f4e7 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-04-28 10:29:41 +02:00
Greg Wilkins 8fcbf6d590
Improve Attributes Handling (#4816)
* Spun out from #4814 Improve Attributes Handling

Improve attribute handling to reduce garbage and improve lookup.
Introduced a Wrapper so that request can remove any layers on reset.

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

* Issue #4814 - Exposing AttributeMap.getAttributeNameSet() on Attributes.

The underlying AttributesMap already has a .getAttributeNameSet()
method, expose it on the Attributes interface.

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

* Allow a set to override a secure attribute.

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

* Issue #4814 - Attributes.getAttributeNames() is now defaulted

The Attributes.getAttributeNames() will use the
.getAttributeNameSet() by default now.

Updated all Attributes.Wrapper impls to use this new behavior

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

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-04-28 10:16:29 +02:00
Jan Bartel 8153efc2e6
Issue #4794 Test for asyncIsStarted for setReadListener (#4804)
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-04-24 10:01:04 +02:00
Jan Bartel 74b6694075
Jetty 10.0.x 4794 http input set read listener (#4796)
* Issue #4794 HttpInput.setReadListener should check async state

Signed-off-by: Jan Bartel <janb@webtide.com>
2020-04-21 15:24:40 +02:00
Greg Wilkins 2addb6a655
Jetty 10.0.x use HandlerList instead of HandlerCollection (#4757)
* Use HandlerList instead of HandlerCollection

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

* Use HandlerList instead of HandlerCollection

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-04-15 18:42:28 +02:00
Jan Bartel 474fa8b8e9
Issue #4762 Request.authenticate must return true if already authenticated (#4763)
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-04-14 12:49:22 +02:00
Simone Bordet 93774ae564 Fixed #4766 - SecuredRedirectHandler should extend HandlerWrapper.
Updated the implementation to extend from HandlerWrapper.
Updated the documentation.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-04-13 14:36:33 +02:00
Simone Bordet 35dce5f315 Improvements to the Jetty server documentation.
Written connector and handler sections.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-04-10 15:40:15 +02:00
Joakim Erdfelt 5699b9ff3d Updating to version 9.4.29-SNAPSHOT 2020-04-08 13:15:04 -05:00
Joakim Erdfelt ab228fde9e Updating to version 9.4.28.v20200408 2020-04-08 12:33:56 -05:00
Jan Bartel bfc9738f86
Issue #4760 Response.setLocale should override previous (#4761)
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-04-08 17:28:14 +02:00
Jan Bartel efe2dc1e90
Issue #4752 Call HttpSessionListener.sessionCreated in add order. (#4753)
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-04-08 11:16:20 +02:00
Simone Bordet e1be62c978 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-04-07 14:54:09 +02:00
Simone Bordet 4e3c0c8cd7 Fixes #4751 - Refresh NetworkTraffic* classes.
Introduced NetworkTrafficSocketChannelEndPoint to replace
NetworkTrafficSelectChannelEndPoint, now deprecated.

Code and javadocs cleanup.

Moved the tests to jetty-client so that also the client is tested.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-04-07 12:04:24 +02:00
Jan Bartel 9726bb88ff Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-04-06 10:58:44 +02:00
Jan Bartel cf0e3c530f
Issue #4662 Ensure contextDestroyed called after filters and servlets destroyed (#4667)
* Issue #4662 Ensure contextDestroyed called after filters and servlets destroyed

Signed-off-by: Jan Bartel <janb@webtide.com>
2020-04-06 10:12:19 +02:00
Joakim Erdfelt 9b57fcd8ee
Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-documentation/src/main/asciidoc/configuring/security/configuring-form-size.adoc
2020-04-02 07:13:32 -05:00
Joakim Erdfelt 1cbb8d0232
Merge pull request #4740 from eclipse/jetty-9.4.x-4638-formcontentsize-doc
Issue #4638 - updating documentation about form limits
2020-04-02 07:03:54 -05:00
Joakim Erdfelt bdaf86d38d
Issue #4638 - updating documentation about form limits
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-04-01 12:44:44 -05:00
Greg Wilkins af895966fa Issue #4711 trailers
Standard trailers cannot be set if committed or HTTP/1.0

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-04-01 17:55:33 +02:00
Joakim Erdfelt 929ce34640
Issue #4529 - Fixing HTML error page from showing servlet info if configured not to do so
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-03-31 14:58:17 -05:00
Simone Bordet 414a1dd396 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-03-31 14:50:48 +02:00
Greg Wilkins ef9e155118
Issue #2074 no merge query string (#4730)
* Issue #4713 Async dispatch with query.

+ Preserve the entire URI with query when startAsync(req,res) is used.
+ merge any query string from dispatch path with either original query or preserved query from forward

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

* Issue #4713 asyncDispatch with query parameters

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

* Issue #2074 Do not merge query strings

Do not merge the query string itself, only the parameter map.
The query string is either the original or replaced by the one from the dispatch.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-03-31 14:26:25 +02:00
Jan Bartel 524e690140
Issue #4682 Session with no attributes unreadable from jdbc (#4688)
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-03-31 14:25:52 +02:00
Jan Bartel 3f7d04ff96
Issue #4719 Keep previous charencoding if not set in content type (#4720)
* Issue #4719 Keep previous charencoding if not set in content type

Signed-off-by: Jan Bartel <janb@webtide.com>

* Issue #4719 - Adding unit tests for charset reset/change

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-03-31 14:24:55 +02:00
Greg Wilkins e3d670d61d
Issue #4713 Async dispatch with query. (#4721)
* Issue #4713 Async dispatch with query.

+ Preserve the entire URI with query when startAsync(req,res) is used.
+ merge any query string from dispatch path with either original query or preserved query from forward

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

* Issue #4713 asyncDispatch with query parameters

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-03-30 16:23:26 +02:00
Simone Bordet 6ed952a9c0 Merges 'jetty-10.0.x' into 'jetty-10.0.x-4400-review_httpclient_content'. 2020-03-30 12:49:39 +02:00
Lachlan d595c59622
Merge pull request #4702 from eclipse/jetty-10.0.x-4603-WS_HTTP2_NPE
Issue #4603 - avoid NPE during websocket HTTP/2 upgrade
2020-03-27 09:44:24 +11:00
Simone Bordet 528d608860 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-03-25 15:22:07 +01:00
Greg Wilkins f4da9760fd Reset trailers on recycled response
Whilst investigating #4711 for jetty-10, it was noticed that trailers are not nulled on recycled Response instances, nor on reset.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-03-25 13:47:34 +01:00
Lachlan Roberts 85ea14e33d Issue #4603 - clarifications in comments and improve test
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-03-25 22:43:43 +11:00
Jan Bartel 0c20622648
Issue #4700 ServletContext.createXXX methods should throw UnsupportedOperationException (#4701)
* Issue #4700 ServletContext.createXXX methods should throw UnsupportedOperationException

Signed-off-by: Jan Bartel <janb@webtide.com>
2020-03-25 11:17:05 +01:00
Lachlan Roberts 035c6d2639 Issue #4603 - avoid NPE during websocket HTTP/2 upgrade
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-03-24 14:46:06 +11:00
olivier lamy b7a4fb7f7e Merge branch 'jetty-9.4.x' into jetty-10.0.x 2020-03-24 11:59:35 +10:00
Simone Bordet e215d071c8 Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-4400-review_httpclient_content'. 2020-03-23 16:24:04 +01:00
Greg Wilkins d45fd14ef8 Revert rename of Response closeOutput to completeOutput #4693
Revert the rename of this method and add a deprecated completeOutput to assist those that used the temporary rename.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-03-23 11:16:04 +01:00
Joakim Erdfelt 7e0fff9a89
Merge pull request #4686 from eclipse/jetty-10.0.x-4685-slf4j-impl-not-included
Issue #4685 - jetty-slf4j-impl not a compile/runtime dependency.
2020-03-20 12:04:32 -05:00
Joakim Erdfelt 43419802b7
Issue #4685 - Declare <scope> for jetty-slf4j-impl everywhere
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-03-20 11:12:08 -05:00
Joakim Erdfelt 2c600f2b68
Issue #4685 - Mark jetty-slf4j-impl as test scope by default
+ Update logging in test-hazelcast-sessions
+ Update logging in test-infinispan-sessions

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-03-20 09:55:15 -05:00
Joakim Erdfelt a16abe1693
Issue #4685 - jetty-slf4j-impl not a compile/runtime dependency.
+ Mark as a test dependency

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-03-19 17:46:41 -05:00
Simone Bordet 9cbd9ab44e Merged 'jetty-10.0.x' into 'jetty-10.0.x-4382-h1_to_h2_upgrade'. 2020-03-19 18:17:57 +01:00
Simone Bordet b22c0b196f Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-03-18 17:00:01 +01:00
Simone Bordet 2940eb8ab5 Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-4382-h1_to_h2_upgrade'. 2020-03-18 11:44:06 +01:00
Simone Bordet f8d9f82eff Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-4400-review_httpclient_content'. 2020-03-18 11:40:11 +01:00
Jan Bartel 1358e5d881 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-03-17 12:20:29 +01:00
Simone Bordet 9bb92f81bd Issue #4443 - Track backport of ALPN APIs to Java 8.
Modified jetty-alpn-openjdk8-* classes to support both
pre 8u252 (via alpn-boot) and post 8u252 (via standard API).

Replaced usages of -Xbootclasspath with -javaagent, and
using Jetty ALPN Agent jar rather than Jetty ALPN boot jar.

Removed all alpn-1.8.0*.mod files since now it is
possible to use a fixed version of the ALPN Agent
to cover all the versions.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-03-17 11:40:29 +01:00
Lachlan 32c9981529
Merge pull request #4674 from eclipse/jetty-9.4.x-4671-CustomRequestLog-CookieNPE
Issue #4671 - fix NPE from CustomRequestLog logRequestCookie
2020-03-17 11:01:50 +11:00