Commit Graph

51 Commits

Author SHA1 Message Date
Ludovic Orban f14c0a5002
Jetty 12.0.x h2c perf improvement: implement equals/hashcode in Stream (#9077)
implement equals/hashcode in H2Stream

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-09 10:37:20 +01:00
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
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 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
Joakim Erdfelt 45d0b68850
Jetty 12 - Fix `GzipHandler` handling of chunked and `Content-Length` (#8927)
* Jetty 12 - Enabling ContentLengthTest.testGzippedContentLengthAddedByServer
* Restoring HttpReceiver
* Fixing RequestTest
* Issue #8927 - Cleanup of GzipResponse with eye on RFC-1952 behaviors
* Issue #8927 - Set FINISHED state
* Fixing HEAD from HTTP/2 and HTTP/3
* Adding requested javadoc
2022-12-06 12:32:01 -06: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 63f1126abc offer EOF data when header frame has the last flag set to true before calling notifyHeaders()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2022-11-29 09:31:49 +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
Greg Wilkins eec5e69079
Converted writeTrailers to a static method (#8940)
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-29 15:08:36 +11: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
Simone Bordet 557490e437
Fixes #8896 - Flaky TrailersTest.
In Jetty 12, demand after last frame invokes onDataAvailable(), so the latch needs to be counted down two times.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-15 19:47:37 +01:00
Simone Bordet bc3aa21b92
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-14 16:11:52 +01:00
Greg Wilkins a812b86663 Fix test for #8887
Don't demand at EOF
2022-11-12 08:46:55 +11:00
Greg Wilkins 681e04d68a Temporary disable test that hangs forever. 2022-11-11 16:36:58 +11:00
Joakim Erdfelt c9b621da84
More flaky tags 2022-11-10 11:57:38 -06:00
Simone Bordet 0e3f3ac316
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-09 12:14:29 +01: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 4225544222
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-11-07 19:34:43 +01:00
Greg Wilkins deb4f3a8e8 Suppress stack in expected warning 2022-11-02 14:42:28 +11:00
Greg Wilkins 8e699866ef Suppress stack in expected warning 2022-11-02 14:37:35 +11:00
Simone Bordet 05e1722045
Relax test case assert.
The test may fail either for a SocketTimeoutException, or a NoRouteToHostException.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-25 15:53:07 +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
Simone Bordet 1119e8b509
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-25 09:59:55 +02:00
Greg Wilkins 1885df7e03 WIP replacing getPathInContext with static method 2022-10-23 22:36:15 +11: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
Olivier Lamy 1f792d48d0 fix javadoc error in http2 Stream class, enable back building javadoc in Jenkinsfile
Signed-off-by: Olivier Lamy <olamy@apache.org>
2022-10-09 07:59:24 +10:00
Simone Bordet c785f08b17
[Jetty 12] Made WebSocket over HTTP/2 work. (#8685)
* Made WebSocket over HTTP/2 work.

Re-enabled tests, and restored HTTP2StreamEndPoint,
as well as implemented getTunnelSupport() for HTTP/2.

Removed from HttpStream methods for upgrade that are
not necessary anymore.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-07 12:50:42 +02:00
Joakim Erdfelt e6ac065966
Fix typo "octect" -> "octet" 2022-10-06 11:28:12 -05:00
Simone Bordet 760257a06f
Merge pull request #8620 from eclipse/jetty-12.0.x-completable-with
Introduced [Callback|Promise]Completable.with(Consumer) to simplify u…
2022-09-27 14:18:35 +02:00
Simone Bordet 70e4ccdaa6
Fixes the case where HTTP/2 readData() was returning EOF
that could not be wrapped in a Chunk, because Data.EOF.retain()
throws UnsupportedOperationException.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-27 14:15:42 +02:00
Simone Bordet 06be091089
Introduced [Callback|Promise]Completable.with(Consumer) to simplify usage of CompletableFuture APIs.
Updated code to use the new APIs.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-26 22:15:17 +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 d3e16fcff9 Updates from reviews.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-21 20:03:49 +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 854d5cdf6a Renamed ee9 client transport tests package.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-21 20:03:49 +02:00
Simone Bordet 0d8af24b6b
Merged branch 'jetty-11.0.x' into 'jetty-12.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-09-15 11:00:03 +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
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 7d264e6024
Jetty 12 module renaming - jetty-http2.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-08-12 09:33:31 +02:00
Lachlan e086cab807
Fixes #8211 - fix ISE from HttpChannelState if failure during process (#8215)
Now all the logic for completion is in lockedOnComplete().

Avoid throwing in ChannelCallback.succeeded() if HttpChannelState._error != null.
This is necessary because HttpChannelState._error may be set asynchronously by
some event such as HTTP/2 reset streams or idle timeouts, but if there is a
thread dispatched to the application the asynchronous event will not fail the
callback, as the failure may be noticed by the application (e.g. via a read() call).

Fixed TrailersTest.testHandlerRequestTrailers() by avoid reading again after
having read the trailers.

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>
2022-08-04 17:06:32 +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
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 a848c51620
Issue #8212 - Exclude spec 8.1.2.6 (#8228)
* Issue #8212 - Exclude spec 8.1.2.6 properly
2022-07-03 16:56:32 -05:00
Lachlan Roberts c8e6bbdf1b Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-06-29 17:28:06 +10: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
Joakim Erdfelt 385f00f72b
Merge remote-tracking branch 'jetty-11.0.x' into `jetty-12.0.x` 2022-05-11 16:52:08 -05:00
Greg Wilkins 367c410e89 Disable flaky test 2022-05-07 11:42:13 +02:00
Greg Wilkins 04acdb72f0 Jetty-12 Restructure
Copied over non ee10 components from the hackathon branch

Co-authored-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Jan Bartel <janb@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim@webtide.com>
Co-authored-by: Lachlan Roberts <lachlan@webtide.com>
Co-authored-by: Ludovic Orban <lorban@webtide.com>
Co-authored-by: Olivier Lamy <olamy@webtide.com>
Co-authored-by: Simone Bordet <sbordet@webtide.com>
2022-05-03 15:50:54 +02:00