diff --git a/jetty-http3/http3-tests/src/test/java/org/eclipse/jetty/http3/tests/ClientServerTest.java b/jetty-http3/http3-tests/src/test/java/org/eclipse/jetty/http3/tests/ClientServerTest.java index 2ac54f3fa96..541a4bc9b73 100644 --- a/jetty-http3/http3-tests/src/test/java/org/eclipse/jetty/http3/tests/ClientServerTest.java +++ b/jetty-http3/http3-tests/src/test/java/org/eclipse/jetty/http3/tests/ClientServerTest.java @@ -264,7 +264,7 @@ public class ClientServerTest extends AbstractClientServerTest stream.data(new DataFrame(ByteBuffer.wrap(bytesSent), true)); assertTrue(clientResponseLatch.await(5, TimeUnit.SECONDS)); - assertTrue(clientDataLatch.await(5, TimeUnit.SECONDS)); + assertTrue(clientDataLatch.await(15, TimeUnit.SECONDS)); assertArrayEquals(bytesSent, bytesReceived); } diff --git a/jetty-quic/quic-quiche/src/main/java/org/eclipse/jetty/quic/quiche/QuicheConnection.java b/jetty-quic/quic-quiche/src/main/java/org/eclipse/jetty/quic/quiche/QuicheConnection.java index 0f154dd3f43..d1d94cb65f8 100644 --- a/jetty-quic/quic-quiche/src/main/java/org/eclipse/jetty/quic/quiche/QuicheConnection.java +++ b/jetty-quic/quic-quiche/src/main/java/org/eclipse/jetty/quic/quiche/QuicheConnection.java @@ -44,6 +44,7 @@ import org.slf4j.LoggerFactory; public class QuicheConnection { private static final Logger LOG = LoggerFactory.getLogger(QuicheConnection.class); + // TODO: cannot be static! private static final SecureRandom SECURE_RANDOM = new SecureRandom(); static @@ -168,7 +169,7 @@ public class QuicheConnection byte[] dcid = new byte[LibQuiche.QUICHE_MAX_CONN_ID_LEN]; size_t_pointer dcid_len = new size_t_pointer(dcid.length); - byte[] token = new byte[48]; // TODO the token buffer size depends on the token minter. + byte[] token = new byte[512]; // TODO the token buffer size depends on the token minter. size_t_pointer token_len = new size_t_pointer(token.length); int rc = LibQuiche.INSTANCE.quiche_header_info(packet, new size_t(packet.remaining()), new size_t(LibQuiche.QUICHE_MAX_CONN_ID_LEN), @@ -200,10 +201,10 @@ public class QuicheConnection byte[] dcid = new byte[LibQuiche.QUICHE_MAX_CONN_ID_LEN]; size_t_pointer dcid_len = new size_t_pointer(dcid.length); - byte[] token = new byte[48]; // TODO the token buffer size depends on the token minter. + byte[] token = new byte[512]; // TODO the token buffer size depends on the token minter. size_t_pointer token_len = new size_t_pointer(token.length); - LOG.debug(" getting header info..."); + LOG.debug("getting header info..."); int rc = LibQuiche.INSTANCE.quiche_header_info(packetRead, new size_t(packetRead.remaining()), new size_t(LibQuiche.QUICHE_MAX_CONN_ID_LEN), version, type, scid, scid_len, @@ -221,7 +222,7 @@ public class QuicheConnection if (!LibQuiche.INSTANCE.quiche_version_is_supported(version.getPointee())) { - LOG.debug(" < version negotiation"); + LOG.debug("version negotiation"); ssize_t generated = LibQuiche.INSTANCE.quiche_negotiate_version(scid, scid_len.getPointee(), dcid, dcid_len.getPointee(), packetToSend, new size_t(packetToSend.remaining())); packetToSend.position(packetToSend.position() + generated.intValue()); @@ -232,7 +233,7 @@ public class QuicheConnection if (token_len.getValue() == 0) { - LOG.debug(" < stateless retry"); + LOG.debug("stateless retry"); token = tokenMinter.mint(dcid, (int)dcid_len.getValue()); @@ -292,24 +293,24 @@ public class QuicheConnection if (!LibQuiche.INSTANCE.quiche_version_is_supported(version.getPointee())) { - LOG.debug(" < need version negotiation"); + LOG.debug("need version negotiation"); return null; } if (token_len.getValue() == 0) { - LOG.debug(" < need stateless retry"); + LOG.debug("need stateless retry"); return null; } - LOG.debug(" token validation..."); + LOG.debug("token validation..."); // Original Destination Connection ID byte[] odcid = tokenValidator.validate(token, (int)token_len.getValue()); if (odcid == null) throw new TokenValidationException("invalid address validation token"); - LOG.debug(" validated token"); + LOG.debug("validated token"); - LOG.debug(" connection creation..."); + LOG.debug("connection creation..."); LibQuiche.quiche_config libQuicheConfig = buildConfig(quicheConfig); SizedStructure s = sockaddr.convert(peer); @@ -321,7 +322,7 @@ public class QuicheConnection throw new IOException("failed to create connection"); } - LOG.debug(" < connection created"); + LOG.debug("connection created"); QuicheConnection quicheConnection = new QuicheConnection(quicheConn, libQuicheConfig); LOG.debug("accepted, immediately receiving the same packet - remaining in buffer: {}", packetRead.remaining()); while (packetRead.hasRemaining())