Commit Graph

292 Commits

Author SHA1 Message Date
Greg Wilkins ec2dbe73a8
Fully async Multipart Form handling (#9975)
A fully async ContentSourceCompletableFuture for use by MultiPartFormData and MultiPartByteRanges
Restructure MultiPartFormData to have a Parser class
---------

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-30 17:01:16 +02:00
Ludovic Orban 457d41ccad
Add constructors accepting the handler to wrap to all core handler wrappers (#9988)
Add constructors accepting the handler to wrap to all core handler wrappers

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-30 13:15:45 +02:00
Ludovic Orban 8f4a15c7da
#9946 Stop passing Handler in constructor as a parent (#9948)
#9946 Stop passing Handler in constructor as a parent

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-06-23 14:44:12 +02:00
Greg Wilkins a3e82326cf
Experiment/jetty 12 chunk isError and warnings (#9904)
* Remove usage of instanceof Content.Chunk.Error
* Updated AsyncContent to accept a transient failures
* Updated AsyncContent to accept a transient failure with inputstream
2023-06-23 09:17:15 +02:00
Simone Bordet 85407aabdb
Updated deploy documentation.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-06-12 17:21:05 +02:00
Greg Wilkins 4c16e6a707
Jetty 12 content length 0 take3 (#9740)
* Optimize Content-Length: 0 handling

Create and use a pre-encoded HttpFields.CONTENT_LENGTH_0 constant
Used the constant in more places
renamed the `putLongField` methods of HttpFields.Mutable to just `put`
Fixed wrong docs examples
2023-05-07 19:22:15 +02:00
Simone Bordet 3463e42861
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-04 12:08:00 +02:00
Simone Bordet 017fec7940
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-04 11:04:30 +02:00
Simone Bordet d4e9f6a520
Fixes #7091 - Add SOCKS5 support.
Spin-off of the work in #9653.
Simplified the implementation, fixed a few mistakes, added more tests.
Made the implementation of Socks5.Authentication more extensible (for example to implement GSSAPI authentication).
Updated documentation.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-03 19:40:55 +02:00
Simone Bordet adf5754836
Fixes #9552 - Jetty 12 - Rewrite of the Jetty WebSocket APIs. (#9652)
* Removed unnecessary classes, among which `BatchMode`, `CloseStatus`, etc.
* Coalesced all listener interfaces into `Session.Listener`.
* Moved `RemoteEndpoint` functionality to `Session`.
* Renamed `WebSocketPolicy` to `Configurable`.
* Renamed `WriteCallback` to just `Callback`, as it is now also used for some listener methods.
* Renamed `@OnWebSocketConnect` to `@OnWebSocketOpen`
* Renamed `Session.Listener.onWebSocketConnect()` to `onWebSocketOpen()`.
* Removed `@WebSocket` annotation attributes, because they were just a subset of the configurable ones and they can be configured directly on the Session instance.
* Removed `Session.suspend()` and `SuspendToken`, and introduced `Session.demand()`.
* Introduced `@WebSocket.autoDemand` and `Session.Listener.AutoDemanding` to support automatic demand upon exit of WebSocket handler methods.
* Removed `FrameHandler.isAutoDemanding()` and `CoreSession.isAutoDemanding()`.
* Changed the responsibility of demand from `WebSocketCoreSession` to `FrameHandler`, which in turn may delegate to `MessageSink`.
* Updated MessageInputStream to fail if an exception is thrown by the application.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-02 16:42:40 +02:00
Greg Wilkins 7275bf15a9
Jetty 12.0.x core security (#9405)
core security module

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: gregw <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-05-02 15:35:49 +02:00
Joakim Erdfelt 1efe9afdf8
Updating to version 11.0.16-SNAPSHOT 2023-04-11 13:53:30 -05:00
Joakim Erdfelt 5bc5e562c8
Updating to version 11.0.15 2023-04-11 13:37:23 -05:00
Joakim Erdfelt ca3c1756ad
Updating to version 10.0.16-SNAPSHOT 2023-04-11 13:23:25 -05:00
Joakim Erdfelt 68017dbd00
Updating to version 10.0.15 2023-04-11 12:24:32 -05:00
Simone Bordet 744b37f80b
Fixes #7608 - Jetty-12 MetaData cleanup needed (#9618)
* Removed unnecessary constructors from MetaData, MetaData.Request and MetaData.Response.
* Removed MetaData.Request.getURIString() (available as getHttpURI().toString()).
* Renamed MetaData.getFields() -> getHttpFields(), as they can be headers or trailers.
* Renamed MetaData.Request.getURI() -> getHttpURI().
* Normalized handling of contentLength, now always -1 (rather than Long.MIN_VALUE) if unknown.
* Permutated MetaData.Response constructor parameters to be consistent with MetaData.Request.
* MetaData.Request's method and httpURI must be non-null.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-04-07 21:23:01 +02:00
Simone Bordet 99dc9c39f5
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-31 15:46:01 +02:00
Simone Bordet 814782cb2f
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-31 15:39:42 +02:00
Simone Bordet 278ec1be69
Fixes #9237 - Decouple QTP idleTimeout from pool shrink rate. (#9498)
Introduced `QueuedThreadPool.maxEvictCount` to be the number of idle threads that are evicted in one idle timeout.

When set to 1 (the default), the old behavior is reproduced: expiring 1 thread every idle timeout.
When set to larger values, allows to keep around the threads for the idle timeout (in case of further load spikes), but allows to quickly recover OS memory when they are truly idle.

For example, with 2000 threads, 30 seconds idle timeout and idleTimeoutMaxShrinkCount=1, it will take 995 minutes (about 16.5 hrs) to shrink the pool back to 10 threads.
By setting idleTimeoutMaxShrinkCount=100, the thread pool can be shrunk to 10 threads in about 10 minutes.

Note also that the new algorithm is more aggressive at shrinking the thread pool.
Previously, a small load might have been sufficient to never evict any thread, because all threads could take turns at executing jobs so that threads were mostly idle but would never really idle time out.
The new algorithm is more aggressive even in presence of a small load, so that if `minThreads` are sufficient to cope with the small load, then the other threads are evicted.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: gregw <gregw@webtide.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: gregw <gregw@webtide.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-03-31 15:36:34 +02:00
Joakim Erdfelt 6ce5a0fbcd
Jetty 12 - Remove CGI servlet (#9516)
* Remove CGI servlet
* Remove CGI references
2023-03-29 09:29:57 -05:00
Simone Bordet f532be828f
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-28 20:22:56 +02:00
Simone Bordet 0243df8f00
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-28 20:09:30 +02:00
Lachlan dde6e04731
Issue #7121 - Add documentation for websocket configuration. (#8931)
* Improvements to WebSocket documentation.
* Documented configuration parameters.
* Documented and added a test case for PathSpec usage.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-28 19:42:44 +02:00
Simone Bordet 856d3338f2
Fixes #9391 - port/move Jetty WebSocket APIs, client and server to je… (#9469)
* Moved -api, -common, -client to jetty-core/jetty-websocket.
* Implemented jetty-core/jetty-websocket/jetty-websocket-jetty-server using only Jetty core APIs, not Servlet.
* Fixed Graceful shutdown order.
* Fixed mistakes in HttpFieldsWrapper, wrongly calling HttpHeader.name() instead of asString().
* Updated tests to pass cleanly.
* Fixed BOMs and POM dependencies.
* Introduced websocket-jetty.mod and websocket-jetty-client.mod, now used by ee10's Jetty WebSocket.
* Fixed OSGi references to old artifactIds.
* Added test to show how to lookup and use ServerWebSocketContainer from a Handler.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-24 19:42:51 +01:00
Simone Bordet 9594469160
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-14 18:52:52 +01:00
Simone Bordet 0871e2fb5d
Merged branch 'jetty-10.0.x' into 'jetty-11.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-14 18:51:12 +01:00
Simone Bordet e6de81084d
Improved HttpClient TLS documentation about server host name verification. (#9494)
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-14 18:49:48 +01:00
Olivier Lamy 22bb0d0788 Updating to version 11.0.15-SNAPSHOT 2023-03-01 18:56:07 +10:00
Olivier Lamy e62cc0344a Updating to version 10.0.15-SNAPSHOT 2023-03-01 18:55:10 +10:00
Greg Poulos 90e6c6a291
Remove logging and Maven plugin scanning sections from old docs (#9401)
* Remove old docs pertaining to logging-logback and logging-log4j* modules
* Remove obsolete logging examples
* Remove centralized-webapp-logging example, because this module no longer exists
* Remove discussion of Logback + Jetty exmaple projects, as these no longer exist
* Remove example of capturing multiple logging frameworks, as the example module file is no longer available to users
* Remove discussion of default logging behavior and console-capture module, which is already covered in the Operations guide
* fix placeholder document header so I can compile
* remove old docs about logging with SLF4J and capturing console output, as this information has already been migrated to the operations guide
* delete remainder of old logging module docs, as these are obsolete and/or adequately captured in the current operations guide
* Remove old logging section altogether, as all the non-obsolete content appears to have already been migrated
* Remove maven section from old docs, since this content has already been ported to the Operations Guide
* Remove maven section from toc
2023-02-26 23:04:03 +01:00
Greg Wilkins 0ca6295cbc
Rename process to handle (#9385)
Renamed Request.Processor to Request.Handler
Renamed Handler.process to Handler.handle
Renamed Rule.Processor to Rule.Handler.
Renamed accordingly methods and variable.
Updated comments accordingly.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-16 18:21:12 +01:00
Simone Bordet b880091fa6
Merged branch 'jetty-12.0.x' into 'gregpoulos-jetty-12.0.x-old-docs-remove-debugging-sections'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-15 18:19:57 +01:00
Simone Bordet 7fa45ebeb2
Merged branch 'jetty-12.0.x' into 'gregpoulos-jetty-12.0.x-old-docs-remove-ant-plugin-guide'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-15 18:11:17 +01:00
gregw a15af55a56 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: gregw <gregw@webtide.com>
2023-02-15 15:31:33 +11:00
gregw 7cfc239990 Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x
Signed-off-by: gregw <gregw@webtide.com>
2023-02-15 15:27:17 +11: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
Greg Poulos ed8074663b remove section on remote debugging, as the information has already been incorporated into the operations and programming guides 2023-02-14 12:29:58 -08:00
Greg Poulos fbcee7ea2d remove sections on debugging with IntelliJ and Eclipse 2023-02-14 12:25:28 -08:00
Greg Poulos c8a0d2c268 remove Ant Jetty plugin section from the ToC 2023-02-14 12:20:27 -08:00
Greg Poulos 450e76dc4e Remove docs for the ant plugin 2023-02-14 12:13:23 -08:00
Greg Poulos b560da195f
Jetty 12.0.x Documentation: Logging section in operations manual (#9187)
* Documentation: added docs for more jetty-logging.properties configuration options
* Update documentation/jetty-documentation/src/main/asciidoc/operations-guide/server/server-logging-server.adoc

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-13 10:21:10 +01:00
Simone Bordet 4db0c70735 Fixes #9326 - Rename DecryptedEndPoint to SslEndPoint.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-09 22:17:51 +01:00
Ludovic Orban b87f9385c8
Jetty 12: Cleanup `StatisticsHandler` (#9291)
#9145 cleanup statistics

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-02-07 17:43:46 +01:00
Simone Bordet d02932f690
Fixes #9288 - Jetty 12 - Use oej.http.HttpCookie in jetty-client. (#9289)
* Replaced usages of java.net.HttpCookie with oej.http.HttpCookie.
* Moved server-side only methods from HttpCookie to HttpCookieUtils.
* Introduced and implemented oej.http.HttpCookieStore.
* Removed now obsolete oej.util.HttpCookieStore.
* Introduced HttpScheme.isSecure(String), to avoid code duplication.
* Fixed handling of cookie "localhost" domain in HttpClient.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-07 17:28:01 +01:00
Greg Wilkins f565122571
Redo Handler renaming (#9318)
* Redo Handler renaming

Wrapper to Singleton
BaseWrapper to Wrapper

* Updates from review
2023-02-07 16:41:15 +11:00
Simone Bordet 5cc07994c0
Issue #9300 - Rename RetainableByteBufferPool to ByteBufferPool
ArrayRetainableByteBufferPool -> ArrayByteBufferPool.
Updated field names.
Updates tests.
Updated *.mod files to not reference RetainableByteBufferPool.
Updated javadocs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-06 10:31:14 +01:00
Simone Bordet 44980ebfc3
Merge branch 'issue/9284' of https://github.com/kohlschuetter/jetty.project into kohlschuetter-issue/9284 2023-02-06 10:16:32 +01:00
Greg Wilkins 60a08f5349
Rename Handler Nested & Collection (#9305)
There is now a Handler interface hierarchy:
 + Container is a Handler that has 1 or more contained Handlers.
 + Wrapper is a Container with only 1 handler and a setHandler method.
 + Collection is a Container with n handlers and a addHandler method

class are now:
 + Abstract implements Handler
 + AbstractContainer extends Abstract implements Container
 + BaseWrapper extends AbstractContainer implements Wrapper
 + Sequence extends AbstractContainer implements Collection

 Lots of other associated cleanups
2023-02-06 12:15:35 +11:00
Christian Kohlschütter b8ab66fd1d Rename RetainableByteBufferPool to ByteBufferPool
With issue #9166, ByteBufferPool was removed and replaced by
RetainableByteBufferPool. Since ByteBufferPool was used by
AbstractConnector, this change broke backwards compatibility with
third-party connectors such as junixsocket-jetty.

Since there's no longer any other ByteBufferPool, rename the
RetainableByteBufferPool interface, and thereby not only reinstate
compatibility with existing third-party libraries but also save a few
keystrokes.

https://github.com/eclipse/jetty.project/issues/9284

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>
2023-02-04 23:39:29 +01:00
Simone Bordet 55a27fc68c
Issue #9293 - Jetty 12 - Relax JPMS dependencies. (#9296)
Relaxed jetty-http2 and submodules JPMS dependencies.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-03 10:19:41 +01:00