Commit Graph

5144 Commits

Author SHA1 Message Date
Joakim Erdfelt 0b0d7d3282
Issue #5133 - Reworking WebAppContext.extraClasspath
+ Now parsed by WebAppContext into List<Resource>
+ Reintroduced Resource.fromList
+ Refactored ResourceFactory to never return null
  and always throw an exception if unable to
  get/create/resolve the Resource

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-08-12 12:50:02 -05:00
Simone Bordet 16cd552995 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-08-11 21:00:43 +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
Jan Bartel e117fbe828
Issue #1337 Use either absolute or relative multipart file location (#5119)
* Issue #1337 Use either absolute or relative multipart file location

Signed-off-by: Jan Bartel <janb@webtide.com>
2020-08-10 10:31:16 +02:00
Simone Bordet dd4c1dbac0 Merged branch 'jetty-9.4.x' into 'jetty-9.4.x-5079-ipv6_brackets'. 2020-08-08 23:21:14 +02:00
Joakim Erdfelt dcf867cd2b
Issue #3916 - Improve multi range response Content-Length calc
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-08-08 11:34:25 -05:00
Joakim Erdfelt 2206b3edae
Issue #3916 - Fixing broken Content-Length evaluation
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-08-08 07:18:02 -05: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
Jan Bartel 437e2be411 Fix license header. 2020-08-05 16:25:01 +02:00
Jan Bartel 8dd205d18f Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-08-05 15:43:08 +02:00
Jan Bartel 4f57810217
Issue #5081 - HouseKeeper synchronization (#5099)
* Issue #5081 HouseKeeper synchronization

Signed-off-by: Jan Bartel <janb@webtide.com>
2020-08-05 15:33:27 +02:00
Simone Bordet 062878f97b Issue #5083 - Convert synchronized usages to AutoLock.
Fixes after merge.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-08-04 17:59:13 +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 d2df0fc2e9 Fixes after review of #4975.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-31 17:59:55 +02:00
Simone Bordet 2fe01626a5 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-07-31 17:47:37 +02:00
Greg Wilkins 66ec16006e
Issue #5088 Review ContextHandler locking (#5094)
* Issue #5088 Review ContextHandler locking

The locking was primarily as a memory guard for the availability status, which was already volatile.
Have instead using an AtomicReference with a simple state machine layered on top of start/stop lifecycle.
There was also protection for AttributesMap, which is no longer needed as AttributesMap is now concurrent.

* Issue #5088

updates from review

* Issue #5088

updates from review (better this time)
2020-07-30 17:58:34 +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
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
Lachlan Roberts 6364490161 restore old ServletPathMapping even for include dispatch types
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-23 23:41:56 +10:00
Lachlan Roberts 5726fa9364 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-23 10:19:53 +10:00
Greg Wilkins 65de149f84
Issue #5057 - Included root context path (#5058)
* Fixes #5057 Included root context path

Root context path in include should be empty string.

* Issue #5057

merged context path methods as result of review.
ServletContent.getContextPath now returns the encoded contextPath (if anybody is silly enough to have one).
2020-07-20 17:35:48 +02:00
Jan Bartel 668174d91d Issue #5025 - wrong welcome file handling with dispatcher.include() and non-default mapping (#5026)
Signed-off-by: Grzegorz Grzybek <gr.grzybek@gmail.com>
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-07-16 12:26:39 +02:00
Lachlan Roberts f0f153cc97 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-07-16 09:10:07 +10:00
Lachlan bbb0f6617c
Merge pull request #5042 from eclipse/jetty-9.4.x-5019-SslReload
Issue #5019 - hot-reload SSL certificates if keystore file changed
2020-07-16 09:09:03 +10:00
Lachlan cadaf87583
Merge pull request #5046 from eclipse/jetty-10.0.x-4985-AttributeNameSet
Issue #4985 - fix NPE related to use of Attributes.Wrapper getAttributeNameSet() Jetty 10
2020-07-16 08:51:56 +10: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 42ea202858
Merge pull request #5047 from eclipse/jetty-9.4.x-moduleCommentDoNotEdit
the "DO NOT EDIT" comment in .mod files should start with '#'
2020-07-16 08:43:00 +10:00
gregw 7c44d0a01a Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-07-15 23:38:04 +02:00
Greg Wilkins 5c1dda3f7c
Issue #5029 Relative Redirection (#5038)
* Issue #5029 Relative Redirection

Provide option to allow relative redirection

* Issue #5029 Relative Redirection

Fixed checkstyle

* rename from review
2020-07-15 23:14:26 +02:00
Grzegorz Grzybek b08fd185c8
Issue #5025 - wrong welcome file handling with dispatcher.include() and non-default mapping (#5026)
Signed-off-by: Grzegorz Grzybek <gr.grzybek@gmail.com>
2020-07-15 14:29:33 +02: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
Lachlan Roberts 037097211c fix cast for HttpServletMapping
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-15 16:03:12 +10:00
Lachlan Roberts 2541f1f648 add javadoc for KeyStoreScanner class
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-15 11:20:57 +10:00
Lachlan Roberts a83844df32 changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-14 16:10:07 +10:00
Lachlan Roberts 62ee077b79 move code of ssl-reload module to jetty-util, move module files to jetty-server
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-13 23:11:09 +10:00
Lachlan Roberts e92d35bd2c fix checkstyle error from extra newline
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-13 15:56:46 +10:00
Lachlan Roberts 6325d4b55c Issue #4985 - fix NPE related to use of Attributes.Wrapper getAttributeNameSet()
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-13 14:17:37 +10: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
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
Jan Bartel 7ca67f9948 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-07-07 14:13:11 +02:00
Lachlan effcccd27a
Merge pull request #4980 from eclipse/jetty-9.4.x-threadPoolDocumentation
fix documentation on where to configure ThreadPool
2020-07-07 18:18:48 +10:00
Simone Bordet ba6a6ea67d Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-07-06 23:10:19 +02:00
Simone Bordet f2c6b67827
Fixes #4971 - Simplify Connection.upgradeFrom()/upgradeTo(). (#5008)
Fixes #4971 - Simplify Connection.upgradeFrom()/upgradeTo().

Now the upgrade-from connection produces a "floating" buffer 
(not belonging to a pool), so that it can release the original buffer.

The upgrade-to connection is free to copy or store this "floating" buffer.

Strengthened ByteBufferPool behavior when releasing non-pooled
ByteBuffers: the buffer is now discarded.

Updated javadocs and all implementations.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-06 22:45:03 +02:00
Lachlan Roberts 085a6112c5 Issue #4985 - revert changes from 9.4 merge to Include, Forward and Async Attributes
The proper ServletPathMapping is not set on the baseRequest when these are constructed
so we can't save fields from this in the constructor. The ServletPathMapping is
later set in the ServletHandler.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-06 16:11:56 +10:00
Lachlan Roberts 345440139b Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-06 12:18:58 +10:00
Lachlan 9a56301de1
Merge pull request #5004 from eclipse/jetty-9.4.x-4985-AttributeNameSet
Issue #4985 - fix NPE related to use of Attributes.Wrapper getAttributeNameSet()
2020-07-06 11:34:27 +10:00
Simone Bordet 7d8e56bd10 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-07-03 16:46:23 +02:00
Simone Bordet ae43b70a9f
Jetty 9.4.x 4967 buffer corruption for http2 failures (#5001)
Fixes #4967 - Possible buffer corruption in HTTP/2 session failures

Partially reverted the changes introduced in #4855, because they
were working only when sends were synchronous.

Introduced ByteBufferPool.remove(ByteBuffer) to fix the issue.
Now when a concurrent failure happens while frames are being
generated or sent, the buffer is discarded instead of being
recycled, therefore resolving the buffer corruption.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-07-03 16:35:33 +02:00
Lachlan Roberts f35d6cfd80 Issue #4985 - remove TODO in Dispatcher
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-07-02 16:02:24 +10:00
Lachlan Roberts 9126b282b1 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-4985-AttributeNameSet 2020-06-30 11:22:41 +10:00
Joakim Erdfelt e1c8a0e8b8
Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-06-25 12:52:29 -05:00
Joakim Erdfelt 3adec35cf5
Fixing CustomImportOrder checkstyle violations
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-06-25 09:25:05 -05:00
Lachlan Roberts 693312a577 Issue #4985 - ensure every attribute in getAttributeNameSet has a non null value
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-06-25 23:15:12 +10:00
Lachlan Roberts 5ce5737395 fix information on ThreadPool configuration
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-06-18 17:45:32 +10:00
Joakim Erdfelt 6795f3915f
Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-06-12 12:04:50 -05: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
Jan Bartel cb09abe873
Issue #4920 Restore ability to invalidate sessions on shutdown (#4933)
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-06-10 18:40:19 +02:00
Simone Bordet dd6cd4b881 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-06-09 16:11:53 +02:00
Simone Bordet 56bda1b3ae
Jetty 9.4.x 4855 h2spec failures (#4946)
* Fixes #4855 - Occasional h2spec failures on CI

In case of bad usage of the HTTP/2 API, we don't want to close()
the stream but just fail the callback, because the stream
may be performing actions triggered by a legit API usage.

In case of a call to `AsyncListener.onError()`, applications may decide to call
AsyncContext.complete() and that would be a correct usage of the Servlet API.
This case was not well handled and was wrongly producing a WARN log with an
`IllegalStateException`.

Completely rewritten `HttpTransportOverHTTP2.TransportCallback`.
The rewrite handles correctly asynchronous failures that now are executed
sequentially (and not concurrently) with writes.
If a write is in progress, the failure will just change the state and at the
end of the write a check on the state will determine what actions to take.

A session failure is now handled in HTTP2Session by first failing all the
streams - which notifies the Stream.Listeners - and then failing the session
- which notifies the Session.Listener.
The stream failures are executed concurrently by dispatching each one to a
different thread; this means that the stream failure callbacks are executed
concurrently (likely sending RST_STREAM frames).
The session failure callback is completed only when all the stream failure
callbacks have completed, to ensure that a GOAWAY frame is processed after
all the RST_STREAM frames.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-06-09 13:15:05 +02:00
olivier lamy 2413f551f1 Merge branch 'jetty-9.4.x' into jetty-10.0.x 2020-06-07 09:30:54 +10:00
Simone Bordet 029470c5dc Fixes #4939 - acceptorQueueSize [sic]
acceptorQueueSize -> acceptQueueSize.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-06-04 18:31:40 +02:00
Lachlan Roberts 86ea115e1f Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-06-04 09:27:43 +10:00
Lachlan Roberts 38f56f5973 make some test methods public to fix build
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-06-04 09:26:35 +10:00
Joakim Erdfelt 426795660f
Cleaning up double-merge final issues.
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-06-03 16:14:32 -05:00
Joakim Erdfelt 90c1fc668c
Merge branch 'jetty-10.0.x' of github.com:eclipse/jetty.project into jetty-10.0.x 2020-06-03 16:10:51 -05:00
Joakim Erdfelt 0cce039e7c
Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-06-03 16:10:41 -05:00
Greg Wilkins 0f48708922 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-06-03 23:01:52 +02:00
Greg Wilkins ff8ae56fa9
Issue #4936 response buffer corruption (#4937)
* Issue #4936 - Adding LargeHeaderTest to replicate issue

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

* Issue #4936 - Updating LargeHeaderTest to use ServerConnector

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

* Issue #4936 - Fail LargeHeaderTest if client detects issues.

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

* Issue #4936 large response header buffer corruption

If the response buffer is too large, the header buffer was released
but not nulled, then an exception thrown, which again released the
not nulled buffer.  The buffer thus ends up in the buffer pool twice!

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

* Issue #4936 large response header buffer corruption

removed old comment

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

Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-06-03 22:54:12 +02:00
Joakim Erdfelt 41440b6c2c
Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-06-01 09:40:43 -05:00
Jan Bartel 42155e889b Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-06-01 14:47:07 +02:00
Joakim Erdfelt f9b75ff1a3
Issue #4923 - Applying changes requested in PR
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-06-01 07:15:07 -05:00
Joakim Erdfelt b6d24c2396
Issue #4923 - Applying changes requested in PR
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-06-01 07:13:28 -05:00
Joakim Erdfelt 6a953e3a0e
Issue #4923 - Applying changes requested in PR
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-05-29 16:30:08 -05:00
Joakim Erdfelt c1c2c07a51
Issue #4923 - restore caching of SSLSession information for SSL Attributes
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-05-29 13:30:59 -05:00
Greg Wilkins fb6a445639
Issue #4741 No Servlet Path (#4898)
* Issue #4741 HttpServletMapping

This completes the refactoring started in #4851, using
the HttpServletMapping field to avoid having the servletPath field
in the Request and instead have a pathInContext field.

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

* Issue #4741 HttpServletMapping

reverted ResourceService changes

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

* Issue #4741 HttpServletMapping

fixed gzip handler

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

* Issue #4741 HttpServletMapping

Fixed several TODOs left in the code
removed _contextPath field and used an attributes lookup for include
replaced setContextPaths with setContext

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

* Issue #4741 HttpServletMapping

Used the same pattern from the contextPath changes for servletPath and pathInfo.   Now the servletPathMapping is always set on the request and only if the dispatch is an include do the effected methods look deeper for the source values.

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

* Issue #4741 HttpServletMapping

Improved javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-05-28 12:17:22 +02:00
Jan Bartel 46f8705b8c Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-05-28 11:14:11 +02:00
Jan Bartel 84cb97e6bd
Issue #4885 do not allow cookies to be set from an include (#4915)
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-05-28 10:51:40 +02:00
Jan Bartel 6f2de51ba1 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-05-27 13:51:37 +02:00
Jan Bartel aae64f181c
Issue #4894 use schema and/or catalog name when creating sessions table (#4908)
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-05-27 13:42:01 +02:00
Greg Wilkins b8c7a9509a Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-05-27 10:11:51 +02:00
Greg Wilkins e82cacfdb6
Jetty 9.4.x single context optimisation (#4909)
* Optimisation for single context

It is a frequent deployment mode to have only a single context.
In that case, the ContextHandlerCollection can bypass a bit of
looping/matching/selecting and just call the single context,
which it works out itself anyway if the request applies to it.

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

* Optimisation for single context

updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-05-27 09:53:13 +02:00
olivier lamy 1249763aad remove changes to DatabaseAdaptor with new fields username/password, use our own username/password in maria_db tests
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-05-27 16:00:23 +10:00
olivier lamy c05bd6c26d use testcontainers/docker to run jdbc sessions tests with Mariadb remote
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-05-27 16:00:23 +10:00
Joakim Erdfelt 5d6f3e2ddc Updating to version 9.4.30-SNAPSHOT 2020-05-21 13:42:25 -05:00
Joakim Erdfelt 77c232aed8 Updating to version 9.4.29.v20200521 2020-05-21 12:04:14 -05:00
Jan Bartel 42e46aee49 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-05-20 23:06:27 +02:00
Jan Bartel 52e7dd4873
Issue #4895 SessionCache flushOnResponseCommit with invalid session (#4896)
Signed-off-by: Jan Bartel <janb@webtide.com>
2020-05-20 23:05:53 +02:00
Lachlan 8d5430bc60
Issue #4741 - fix issues with HttpServletMapping (#4851)
* Issue #4741 - fixes to jetty implementation of HttpServletMapping

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* Issue #4741 - don't lazily generate HttpServletMapping to preserve servletName

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* Issue #4741 - tests should expect no leading / for matchValue

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* resolving TODOs from review

- removed pathSpec from Request
- getServletMapping moved to ServletHandler

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* Issue #4741 - only create HttpServletMapping for exact matches once

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* use wrapped attributes for async dispatch

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* Issue #4741 - Changes from review, revert async attribute wrapping

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* Issue #4741 - Changes from review

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* Issue #4741 Async ServletMapping

Greatly increased the scope of this PR by combining the servletPath and
pathInfo into the ServletPathMapping class that implements the
HttpServletPathMapping interface.    This allows us to greatly simplify
the matching of servlets and reduce the number of times we need to
actually to the match per request.

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

* Issue #4741 Async ServletMapping

Fixed problems with previous commit
more cleanup of attributes in dispatcher.

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

* Issue #4741 Async ServletMapping

More code cleanups

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

* Issue #4741 Async ServletMapping

Named dispatch cleanup

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

* Issue #4741 Async ServletMapping

misc cleanup

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

* Issue #4741 Async HttpServletMapping

Added tests for named dispatchers
Do not use ServletPathMapping for named dispatch

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

* Issue #4741 Async HttpServletMapping

renamed confusing isDefault method on ServletMapping

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

* Issue #4741 Async HttpServletMapping

simplified setAttribute

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

* Issue #4741 Async HttpServletMapping

added javadoc about AsyncAttributes

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

* Issue #4741 Async HttpServletMapping

Fixed javadoc

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

Co-authored-by: Greg Wilkins <gregw@webtide.com>
2020-05-20 15:23:32 +02:00
Lachlan Roberts ccaca1892e Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-05-14 13:37:13 +10:00
Lachlan Roberts 7111f5f161 Issue #4861 - AsyncAttributes should wrap ServletAttributes inner AttributesMap
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-05-14 08:33:31 +10:00
Lachlan Roberts 4aece5e9cf Issue #4861 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-05-13 23:12:22 +10:00
Lachlan Roberts 629e106045 Issue #4861 - increase efficiency of ServletAttributes when going async
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-05-13 19:10:11 +10:00
Lachlan Roberts 9f39fd1dd1 Issue #4861 - reduce garbage created by the async request attributes
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2020-05-12 18:28:23 +10:00
Joakim Erdfelt 822d98b023
Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-05-11 21:16:59 -05:00
Joakim Erdfelt 86a40a07d6
Merge pull request #4863 from eclipse/jetty-9.4.x-4860-NullHttpFields
Issue #4860 - NPE from HttpFields
2020-05-11 21:04:50 -05:00
Greg Wilkins 3b33ed2af2 Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-05-11 21:48:31 +02:00
Greg Wilkins e86977394e
Issue #4828 Buffer Corruption (#4864)
+ improve synchronization around releaseBuffer
 + improve synchronization around acquireBuffer
 + made acquireBuffer private.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-05-11 21:48:06 +02:00
Greg Wilkins c07409dc62 Merge branch 'jetty-10.0.x' of github.com:eclipse/jetty.project into jetty-10.0.x 2020-05-11 21:47:56 +02:00
Greg Wilkins c497b61917 Issue #4860 NPE from HttpFields
Paranoid catch if sending and exception page throws an exception.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-05-11 13:57:17 +02:00
Simone Bordet 63bfb43b2f Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-05-08 15:23:00 +02:00
Ludovic Orban 409db8d065 introduce socket configuration properties in Jetty XML files
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-05-08 13:14:50 +02:00
olivier lamy 43cc48d003 fix jpms configuration for test
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2020-05-08 12:56:21 +10:00
olivier lamy 972cd95ec0 Merge branch 'jetty-9.4.x' into jetty-10.0.x 2020-05-08 10:21:41 +10:00
Ludovic Orban 072cc978fb
add HttpConfiguration.Customizer implementation that sets request attributes containing the real local and remote address:port pairs (#4849)
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-05-07 19:53:15 +02:00
Joakim Erdfelt c50a52a392
Merge pull request #4844 from lorban/jetty-9.4.x-4843-proxyv2-ignored-address-length
proxy v2 skip address length bytes when LOCAL command is specified
2020-05-07 10:16:57 -05:00
Greg Wilkins ed37a1e2fc Minor cleanup
Use existing method (which may cache value) rather than inlined code.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2020-05-06 11:18:44 +02:00
Joakim Erdfelt eba5028bcf
Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x 2020-05-05 10:03:27 -05:00
Joakim Erdfelt e4fd49dc36
Merge pull request #4838 from eclipse/jetty-9.4.x-4835-gziphandler-flush
Issue #4835 - Addressing flush/commit with GzipHttpOutputInterceptor
2020-05-05 09:54:41 -05:00
Ludovic Orban d34cb2598b proxy v2 skip address length bytes when LOCAL command is specified
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2020-05-05 13:51:30 +02:00
Simone Bordet 1c22de433b Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-05-04 19:11:26 +02:00
Joakim Erdfelt d58da0f7d2
Issue #4824 - Addressing flush/commit with GzipHttpOutputInterceptor
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-05-04 09:22:08 -05:00
Simone Bordet 99ecfca439 Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'. 2020-05-04 13:00:15 +02:00
Simone Bordet 2fa161c515
Merge pull request #4790 from eclipse/jetty-9.4.x-4778-sni_with_one_certificate
Fixes #4778 - Enforcing SNI when there are only non-wildcards certifi…
2020-05-04 11:35:04 +02:00
Joakim Erdfelt c645d0f7c4
Issue #4835 - Addressing flush/commit with GzipHttpOutputInterceptor
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2020-05-01 14:42:08 -05:00
Jan Bartel f154151016
Jetty 10.0.x 4825 pushbuilder (#4829)
* Issue #4825 Implement spec requirements for Request.newPushBuilder

Signed-off-by: Jan Bartel <janb@webtide.com>
2020-05-01 11:07:06 +02:00
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
Simone Bordet 426c80bf6d Fixes #4778 - Enforcing SNI when there are only non-wildcards certificates.
If SNI is required, wrap the KeyManagers with SniX509ExtendedKeyManager.
Updated the main keystore file to only have one certificate (instead of two),
since there never was the need for two certificates in the tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2020-04-18 18:15:03 +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