Commit Graph

56 Commits

Author SHA1 Message Date
Ludovic Orban fcbdab8b3e
Rework client content listeners (#8981)
* Removed DemandedContentListener
* Updated AsyncContentListener signature
* Updated documentation

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-04 11:01:18 +01:00
Joakim Erdfelt f1b8bf5663
Merge pull request #9122 from eclipse/fix/jetty-12.0.x/remove-client-usage-class
Jetty 12 : Removing client `Usage.java` as the examples have been moved to documentation
2023-01-03 13:29:33 -06:00
Joakim Erdfelt c2f04f5efc
Merge pull request #9117 from eclipse/fix/jetty-12.0.x/enable-connectionpooltest
Removing `@Disabled` from `ConnectionPoolTest`
2023-01-03 11:10:43 -06:00
Joakim Erdfelt 8abebdbe17
Removing client Usage.java as the examples have been moved to documentation 2023-01-03 11:07:53 -06:00
Joakim Erdfelt 6a942f66d9
Removing @Disabled from HttpCookieTest 2023-01-02 14:31:29 -06:00
Joakim Erdfelt e5a6622f37
Removing @Disabled from ConnectionPoolTest 2023-01-02 11:55:22 -06:00
Greg Wilkins c18e790858
Jetty 12 handler as boolean processor (#9035)
Alternative Handler architecture.

All Handlers are Processors, which now return a boolean to indicate the request has been accepted.
The request/response/callback are no longer modal, so there is no race with the boolean return.

Optimized PathMappings.
Avoid iterations if only ServletPathSpec instances
Avoid tests for empty mappings.
Better reset implementation
Improve suffix matching
Improve exact matching

Renamed HttpStream.getNanoTimeStamp() to getNanoTime().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2022-12-19 16:02:26 +01:00
Joakim Erdfelt 3c4fdad9ce
Enable ExternalSiteTest 2022-12-14 13:43:25 -06:00
Simone Bordet d3a0aa281b
Fixed flaky test MultiPartRequestContentTest.
The problem was that sometimes content bytes generated randomically ended with \r, confusing the multipart parser.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-12-09 15:58:57 +01:00
Simone Bordet bc0b4149ff
Clarified HttpReceiver.responseFailure().
Added javadocs to relevant methods in HttpChannel.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-12-07 23:50:39 +01:00
Joakim Erdfelt 2d9c735d63
Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-12-06 14:38:53 -06:00
Ludovic Orban 017b6c1391 fcgi and ContentTransformer bug fixes
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-12-06 20:04:30 +01:00
Ludovic Orban 42186bff18 #8993: Disallow creating new chunks with an empty ByteBuffer to make Chunk.isTerminal() contract stricter
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-12-06 19:48:17 +01:00
Simone Bordet d5054667df
Improved locking for HttpReceiver.ContentSource. (#9007)
* Improved locking for HttpReceiver.ContentSource.

Improved response failure code path.
Now either responseFailure() must be called, or exchange.responseComplete() followed by HttpReceiver.abort().

Fixed failAndClose() for HTTP/2 and HTTP/3: the connection must not be closed, stream.reset() is sufficient.

Fixed flaky test HttpClientDemandTest.testTwoListenersWithDifferentDemand().

Fixed DistributionTests.testVirtualThreadPool().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-12-06 15:09:48 +01:00
Ludovic Orban 12e48a7241 replace FSM with SerializedInvoker
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-11-29 09:31:49 +01:00
Simone Bordet e7f6f6729a
Restored server push functionality. (#8760)
* Restored server push functionality.

* Moved Request.isPushSupported() to ConnectionMetaData.
* Removed HttpStream.isPushSupported().
* Implemented ee10 PushBuilder.
* Moved PushCacheFilterTest from core to ee10.
* Duplicated PushCacheFilterTest to ee9.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Greg Wilkins <gregw@webtide.com>
2022-11-21 12:18:19 +01:00
Joakim Erdfelt 08c47f5f57
Jetty 12 - use JVM provided null OutputStream (#8789)
* Remove IO.getNull* methods and use JVM versions

+ This also honors the open/close/error on
  bad use of the streams/writers
2022-11-09 07:06:43 -06:00
Simone Bordet bb3355be83
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-08 22:26:39 +01:00
Simone Bordet 3e9bebd05a
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-28 16:20:17 +02:00
Greg Wilkins 9dc9eaa711 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12-static-pathInContext 2022-10-25 20:42:25 +11:00
Gili Tzabari 0724d1090d
Fixes #8723: Provide a thread-safe way to modify HttpClient proxies at runtime. 2022-10-25 10:23:04 +02:00
Greg Wilkins 1885df7e03 WIP replacing getPathInContext with static method 2022-10-23 22:36:15 +11:00
Simone Bordet 76ca392917
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-22 15:11:26 +02:00
Ludovic Orban 38289e46d4
Make Client's Request and Response `abort()` fully async (#8725)
Changed Request and Response abort() to be fully async by returning a CompletableFuture<Boolean>

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-10-21 15:32:46 +02:00
Simone Bordet ed3d4a46c7
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-19 18:36:25 +02:00
Simone Bordet d3d83d0028
Merged PR #7800 to `jetty-12.0.x`.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-10 16:32:26 +02:00
Simone Bordet 7ed59f46c8
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-05 12:16:02 +02:00
Simone Bordet b5541d9fb8
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-27 12:47:38 +02:00
Simone Bordet f8f60822a7
Restored interim responses functionality (100 Continue, 102 Processing, 103 Early Hints) (#8615)
* Restored interim responses functionality (100 Continue, 102 Processing, 103 Early Hints) for core, ee9 and ee10.

Added ProcessingProtocolHandler and EarlyHintsProtocolHandler for the client.

Re-enabled all tests for interim responses for all protocols.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-26 16:48:11 +02:00
Simone Bordet 910bb41702 Removed duplicate client transport tests already present in core.
Properly implemented request and response trailers for all the transports, both client and server.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-21 20:03:49 +02:00
Simone Bordet 8e68505524 Moving from ee9 to core more client transport tests.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-21 20:03:49 +02:00
Simone Bordet 8953873e67
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-06 12:31:54 +02:00
Ludovic Orban 314c802e03 Removed deprecated methods
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-09-02 18:14:48 +02:00
Ludovic Orban bb83e835cf Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-09-02 09:12:24 +02:00
Simone Bordet b5332c38a9 Implemented ranged requests and responses.
Refactored MultiPart so that the different behavior between
multipart/form-data and multipart/byteranges is captured in the code.

Renamed MultiParts to MultiPartFormData, and ServletMultiParts to ServletMultiPartFormData.

Introduced MultiPartByteRanges and used it to implement ranges in ResourceService.
Re-enabled multipart tests for ranges that were disabled, and added more.

Modernized and simplified implementation of ByteRange.
Updated ByteRangeTest.

Removed RangeWriter and its subclasses and their tests, as they are not used anymore.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-08-15 17:32:02 +02:00
Simone Bordet 21fce4ffb9
Pool and ConnectionPool code cleanups
Code cleanup, removing deprecations, for class Pool,
ConnectionPool and its implementations.

Removed DuplexHttpDestination and MultiplexHttpDestination.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-08-13 10:01:36 +02:00
Simone Bordet 90fc840f43
Jetty 12 : Renamed FutureFormFields to just FormFields, as it is mostly used (#8411)
Renamed FutureFormFields to just FormFields, as it is mostly used
as a CompletableFuture, and the "Future" prefix is soo Java 5 :)

Improved releasing of chunks in FormFields implementation.

Improved configuration of FormFields for max number of fields and max form content length.

Fixed Field.toString().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-08-04 17:18:13 +02:00
Simone Bordet c077bbecaa
Jetty 12.0.x MultiPart (#8201)
Moved multipart test files to jetty-http.

Introduced jetty-http `MultiPart` class and made `MultiPart.Parser` non-blocking and lenient on newlines.
Made `MultiPartCaptureTest` to pass.

Moved o.e.j.server.MultiPartParserTest tests to o.e.j.http.MultiPartTest.

Renamed MultiPartFormInputStreamTest to MultiPartsTest.

Introduced class o.e.j.server.MultiParts, a CompletableFuture of Parts
that can be used asynchronously in Handlers and in general in core Jetty.

Implemented multi-part handling in ee10.

Implemented DelayedHandler.UntilMultiPart.

Introduced MultiPart.ContentSource as the multipart "generator".

Replaced ByteBuffer/boolean pair with Chunk and implement Chunk slicing & improve retainability for MultiPart parser.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2022-08-04 17:03:40 +02:00
Joakim Erdfelt 3006994b14
Use real pom for jetty-client, not dependency-reduced
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-08-01 17:19:17 -05:00
Simone Bordet 4491f1b544
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-07-28 19:11:41 +02:00
Simone Bordet 69a7b06f06
Jetty 12.0.x retainable chunk (#8325)
Made Chunk implement Retainable, and protocol implementations
to link the RetainableByteBuffer all the way to the Chunk.

Extended Retainable to have both a retain() and a release() methods.

Removed HTTP/2's ISession and IStream, now just using HTTP2Session and HTTP2Stream.
Removed *.Adapter classes in favor of interfaces with default methods.

Javadoc additions and clarifications.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-07-25 13:22:14 +02:00
Simone Bordet 8cb09e4c59
Re-enabled jetty-ee9-proxy and jetty-ee10-proxy modules. (#8289)
* Re-enabled jetty-ee9-proxy and jetty-ee10-proxy modules.
Introduced TunnelSupport to abstract out the tunnelling capabilities.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-07-22 13:36:47 +02:00
Greg Wilkins 676833e57e
Jetty-12 Improved Content testing and javadoc (#8263)
Improved Content javadoc
Fixed ContentSourceTest that was consuming the same ByteBufferSource multiple times.
Using ByteBufferPool.NOOP instead of allocating NoopByteBufferPool.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2022-07-08 14:52:28 +02:00
Greg Wilkins 4c827b986c Minor renaming for clarity
Renamed Blocking to Blocker
Added Handler.Processor.Blocking and Handler.Processor.NonBlocking
2022-07-07 19:38:23 +10:00
Greg Wilkins fe83ea87dc Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-07-04 11:32:33 +10:00
Joakim Erdfelt 5bac16b434
Fixing bad merge from jetty-11.0.x
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2022-06-15 15:08:00 -05:00
Simone Bordet 55a3da5cb7
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-06-15 16:14:28 +02:00
Simone Bordet 353d054fcb
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-06-03 09:29:02 +02:00
Simone Bordet cbeeb67e93
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-06-01 15:18:53 +02:00
Simone Bordet 7a6ccce49a
Rewrite of the content handling, both on client and on server. (#7985)
Introduced a new io.Content class, with Content.Source, Content.Sink and Content.Chunk.

Updated the server-side to use io.Content instead of the previous server-side Content class.
Updated the client-side to use io.Content with a little specialization necessary for clients only.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2022-05-30 13:34:51 +02:00