From 2e98931654e3b45bdc517be11501b64dad9f7e4e Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Mon, 27 Sep 2021 22:45:06 +0200 Subject: [PATCH] Issue #6728 - QUIC and HTTP/3 - Fixed module-info.java for HTTP/3 modules. - Updated package-info.java for QUIC. Signed-off-by: Simone Bordet --- .../src/main/java/module-info.java | 1 - .../src/main/java/module-info.java | 4 +- .../jetty/http3/{ => internal}/ErrorCode.java | 2 +- .../http3/internal/parser/BodyParser.java | 2 +- .../http3/internal/parser/ControlParser.java | 2 +- .../internal/parser/HeadersBodyParser.java | 2 +- .../http3/internal/parser/MessageParser.java | 2 +- .../internal/parser/SettingsBodyParser.java | 2 +- .../src/main/java/module-info.java | 1 - .../jetty/quic/common/package-info.java | 37 ++++++++++++------- 10 files changed, 30 insertions(+), 25 deletions(-) rename jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/{ => internal}/ErrorCode.java (96%) diff --git a/jetty-http3/http3-client/src/main/java/module-info.java b/jetty-http3/http3-client/src/main/java/module-info.java index 6fa6a7002cc..e19956edea3 100644 --- a/jetty-http3/http3-client/src/main/java/module-info.java +++ b/jetty-http3/http3-client/src/main/java/module-info.java @@ -14,7 +14,6 @@ module org.eclipse.jetty.http3.client { exports org.eclipse.jetty.http3.client; - exports org.eclipse.jetty.http3.client.internal; requires transitive org.eclipse.jetty.http3.common; requires transitive org.eclipse.jetty.http3.qpack; diff --git a/jetty-http3/http3-common/src/main/java/module-info.java b/jetty-http3/http3-common/src/main/java/module-info.java index c9ac9cf6815..37533969d16 100644 --- a/jetty-http3/http3-common/src/main/java/module-info.java +++ b/jetty-http3/http3-common/src/main/java/module-info.java @@ -13,13 +13,11 @@ module org.eclipse.jetty.http3.common { - exports org.eclipse.jetty.http3; exports org.eclipse.jetty.http3.api; exports org.eclipse.jetty.http3.frames; - + exports org.eclipse.jetty.http3.internal to org.eclipse.jetty.http3.client, org.eclipse.jetty.http3.server; exports org.eclipse.jetty.http3.internal.generator to org.eclipse.jetty.http3.client, org.eclipse.jetty.http3.server; exports org.eclipse.jetty.http3.internal.parser to org.eclipse.jetty.http3.client, org.eclipse.jetty.http3.server; - exports org.eclipse.jetty.http3.internal; requires transitive org.eclipse.jetty.http; requires transitive org.eclipse.jetty.http3.qpack; diff --git a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/ErrorCode.java b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/ErrorCode.java similarity index 96% rename from jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/ErrorCode.java rename to jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/ErrorCode.java index 6e9c83cfca9..9148b6a3078 100644 --- a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/ErrorCode.java +++ b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/ErrorCode.java @@ -11,7 +11,7 @@ // ======================================================================== // -package org.eclipse.jetty.http3; +package org.eclipse.jetty.http3.internal; public enum ErrorCode { diff --git a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/BodyParser.java b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/BodyParser.java index bd2a3b442ec..97ff208b71f 100644 --- a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/BodyParser.java +++ b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/BodyParser.java @@ -15,8 +15,8 @@ package org.eclipse.jetty.http3.internal.parser; import java.nio.ByteBuffer; -import org.eclipse.jetty.http3.ErrorCode; import org.eclipse.jetty.http3.frames.SettingsFrame; +import org.eclipse.jetty.http3.internal.ErrorCode; import org.eclipse.jetty.util.BufferUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/ControlParser.java b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/ControlParser.java index cbc38f73809..2cf5f4a3365 100644 --- a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/ControlParser.java +++ b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/ControlParser.java @@ -15,8 +15,8 @@ package org.eclipse.jetty.http3.internal.parser; import java.nio.ByteBuffer; -import org.eclipse.jetty.http3.ErrorCode; import org.eclipse.jetty.http3.frames.FrameType; +import org.eclipse.jetty.http3.internal.ErrorCode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/HeadersBodyParser.java b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/HeadersBodyParser.java index 635ab0ab6ae..d7484e1d5f3 100644 --- a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/HeadersBodyParser.java +++ b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/HeadersBodyParser.java @@ -19,8 +19,8 @@ import java.util.List; import java.util.function.BooleanSupplier; import org.eclipse.jetty.http.MetaData; -import org.eclipse.jetty.http3.ErrorCode; import org.eclipse.jetty.http3.frames.HeadersFrame; +import org.eclipse.jetty.http3.internal.ErrorCode; import org.eclipse.jetty.http3.qpack.QpackDecoder; import org.eclipse.jetty.http3.qpack.QpackException; import org.eclipse.jetty.util.BufferUtil; diff --git a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/MessageParser.java b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/MessageParser.java index c73171f95d2..26462f73473 100644 --- a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/MessageParser.java +++ b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/MessageParser.java @@ -17,8 +17,8 @@ import java.nio.ByteBuffer; import java.util.function.BooleanSupplier; import java.util.function.UnaryOperator; -import org.eclipse.jetty.http3.ErrorCode; import org.eclipse.jetty.http3.frames.FrameType; +import org.eclipse.jetty.http3.internal.ErrorCode; import org.eclipse.jetty.http3.qpack.QpackDecoder; import org.eclipse.jetty.util.BufferUtil; import org.slf4j.Logger; diff --git a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/SettingsBodyParser.java b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/SettingsBodyParser.java index f5d03465bb8..a04bcdb42f0 100644 --- a/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/SettingsBodyParser.java +++ b/jetty-http3/http3-common/src/main/java/org/eclipse/jetty/http3/internal/parser/SettingsBodyParser.java @@ -17,8 +17,8 @@ import java.nio.ByteBuffer; import java.util.LinkedHashMap; import java.util.Map; -import org.eclipse.jetty.http3.ErrorCode; import org.eclipse.jetty.http3.frames.SettingsFrame; +import org.eclipse.jetty.http3.internal.ErrorCode; import org.eclipse.jetty.http3.internal.VarLenInt; public class SettingsBodyParser extends BodyParser diff --git a/jetty-http3/http3-server/src/main/java/module-info.java b/jetty-http3/http3-server/src/main/java/module-info.java index c5b5d778b7a..944ce5749e8 100644 --- a/jetty-http3/http3-server/src/main/java/module-info.java +++ b/jetty-http3/http3-server/src/main/java/module-info.java @@ -14,7 +14,6 @@ module org.eclipse.jetty.http3.server { exports org.eclipse.jetty.http3.server; - exports org.eclipse.jetty.http3.server.internal; requires transitive org.eclipse.jetty.http3.common; requires transitive org.eclipse.jetty.http3.qpack; diff --git a/jetty-quic/quic-common/src/main/java/org/eclipse/jetty/quic/common/package-info.java b/jetty-quic/quic-common/src/main/java/org/eclipse/jetty/quic/common/package-info.java index d7b265b7c45..2d4cfc07d6b 100644 --- a/jetty-quic/quic-common/src/main/java/org/eclipse/jetty/quic/common/package-info.java +++ b/jetty-quic/quic-common/src/main/java/org/eclipse/jetty/quic/common/package-info.java @@ -14,30 +14,39 @@ /** *

This module contains the main abstractions for the QUIC protocol.

*

A {@link org.eclipse.jetty.quic.common.QuicConnection} is a {@link org.eclipse.jetty.io.Connection} - * that receives and sends bytes from its underlying datagram {@link org.eclipse.jetty.io.EndPoint}.

+ * that receives and sends bytes from its underlying {@link org.eclipse.jetty.io.DatagramChannelEndPoint}.

*

A {@link org.eclipse.jetty.quic.common.QuicConnection} manages many {@link org.eclipse.jetty.quic.common.QuicSession}s, * one for each QUIC connection ID.

*

A {@link org.eclipse.jetty.quic.common.QuicSession} manages many QUIC streams, identified by a - * stream ID and represented by an {@link org.eclipse.jetty.io.EndPoint} subclass, namely - * {@link org.eclipse.jetty.quic.common.QuicStreamEndPoint}.

+ * stream ID and represented by {@link org.eclipse.jetty.quic.common.QuicStreamEndPoint}.

+ *

A {@link org.eclipse.jetty.quic.common.QuicSession} delegates I/O processing to a protocol-specific + * {@link org.eclipse.jetty.quic.common.ProtocolSession}, whose responsibility is to use QUIC streams + * to implement the protocol-specific I/O processing.

*

The {@link org.eclipse.jetty.io.Connection} associated with each {@link org.eclipse.jetty.quic.common.QuicStreamEndPoint} - * parses the bytes received on that QUIC stream, and generates the bytes to send on that QUIC stream.

- *

For example, on the server side, the layout of the components in case of HTTP/1.1 could be the following:

+ * parses the bytes received on the QUIC stream represented by the {@link org.eclipse.jetty.quic.common.QuicStreamEndPoint}, + * and generates the bytes to send on that QUIC stream.

+ *

On the client side, the layout of the components in case of HTTP/1.1 could be the following:

+ *
+ * DatagramChannelEndPoint -- QuicConnection -- QuicSession -- ProtocolSession -- QuicStreamEndPoint -- HttpConnectionOverHTTP
+ * 
+ *

The client-specific {@link org.eclipse.jetty.quic.common.ProtocolSession} creates a bidirectional QUIC stream + * that represent the same transport as a TCP stream, over which HTTP/1.1 bytes are exchanged by the two peers.

+ *

On the server side, the layout of the components in case of HTTP/1.1 could be the following:

*
  * CLIENT  |  SERVER
  *
- * clientA                                                     ServerQuicSessionA
- *         \                                                 /
- *           DatagramChannelEndPoint -- ServerQuicConnection
- *         /                                                 \
- * clientB                                                     ServerQuicSessionB -- QuicStreamEndPointB1 -- HttpConnection
+ * clientA                                              QuicSessionA -- ProtocolSessionA -- QuicStreamEndPointA -- HttpConnection
+ *         \                                           /
+ *           DatagramChannelEndPoint -- QuicConnection
+ *         /                                           \
+ * clientB                                              QuicSessionB -- ProtocolSessionB -- QuicStreamEndPointB -- HttpConnection
  * 
*

The {@code DatagramChannelEndPoint} receives UDP datagrams from clients.

- *

{@code ServerQuicConnection} processes the incoming datagram bytes creating a {@code ServerQuicSession} for every + *

{@code QuicConnection} processes the incoming datagram bytes creating a {@code QuicSession} for every * QUIC connection ID sent by the clients.

- *

{@code clientB} has created a single QUIC stream to send a single HTTP/1.1 request, which results in - * {@code ServerQuicSessionB} to create a single {@code QuicStreamEndPointB1} with its associated {@code HttpConnection}.

- *

Note that the path {@code DatagramChannelEndPoint - ServerQuicConnection - ServerQuicSessionB - QuicStreamEndPointB1} + *

The clients have created a single QUIC stream to send HTTP/1.1 requests, which results in the + * {@code QuicSession}s to create a correspondent {@code QuicStreamEndPoint} with its associated {@code HttpConnection}.

+ *

The path {@code DatagramChannelEndPoint - QuicConnection - QuicSession - QuicStreamEndPoint} * behaves exactly like a TCP {@link org.eclipse.jetty.io.SocketChannelEndPoint} for the associated * {@code HttpConnection}.

*/