diff --git a/jetty-http3/http3-server/src/main/java/org/eclipse/jetty/http3/server/internal/HttpChannelOverHTTP3.java b/jetty-http3/http3-server/src/main/java/org/eclipse/jetty/http3/server/internal/HttpChannelOverHTTP3.java index f91b831fece..06554f7005b 100644 --- a/jetty-http3/http3-server/src/main/java/org/eclipse/jetty/http3/server/internal/HttpChannelOverHTTP3.java +++ b/jetty-http3/http3-server/src/main/java/org/eclipse/jetty/http3/server/internal/HttpChannelOverHTTP3.java @@ -297,16 +297,12 @@ public class HttpChannelOverHTTP3 extends HttpChannel } } - Stream.Data data = stream.readData(); - if (data != null) + HttpInput.Content result = readContent(); + + if (result != null) { - HttpInput.Content result = newContent(data); - try (AutoLock l = lock.lock()) - { - if (LOG.isDebugEnabled()) - LOG.debug("need content read content {} on {}", result, this); - content = result; - } + if (LOG.isDebugEnabled()) + LOG.debug("need content read content {} on {}", this.content, this); return true; } @@ -322,40 +318,15 @@ public class HttpChannelOverHTTP3 extends HttpChannel HttpInput.Content result; try (AutoLock l = lock.lock()) { - if (content != null) - { - result = content; - if (!result.isSpecial()) - content = null; - if (LOG.isDebugEnabled()) - LOG.debug("produced content {} on {}", result, this); - return result; - } + result = content; } - Stream.Data data = stream.readData(); - if (LOG.isDebugEnabled()) - LOG.debug("read {} on {}", data, this); - if (data == null) + if (result == null) + result = readContent(); + + if (result == null) return null; - result = newContent(data); - try (AutoLock l = lock.lock()) - { - content = result; - } - - boolean handle = onContent(result); - - boolean isLast = data.isLast(); - if (isLast) - { - boolean handleContent = onContentComplete(); - // This will generate EOF -> must happen before onContentProducible(). - boolean handleRequest = onRequestComplete(); - handle |= handleContent | handleRequest; - } - if (!result.isSpecial()) { HttpInput.Content newContent = result.isEof() ? new HttpInput.EofContent() : null; @@ -365,10 +336,41 @@ public class HttpChannelOverHTTP3 extends HttpChannel } } if (LOG.isDebugEnabled()) - LOG.debug("produced new content {} on {}", result, this); + LOG.debug("produced content {} on {}", result, this); return result; } + private HttpInput.Content readContent() + { + Stream.Data data = stream.readData(); + if (LOG.isDebugEnabled()) + LOG.debug("read data {} on {}", data, this); + if (data != null) + { + HttpInput.Content result = newContent(data); + + boolean handle = onContent(result); + + try (AutoLock l = lock.lock()) + { + if (LOG.isDebugEnabled()) + LOG.debug("read content {} on {}", result, this); + content = result; + } + + if (data.isLast()) + { + boolean handleContent = onContentComplete(); + // This will generate EOF -> must happen before onContentProducible(). + boolean handleRequest = onRequestComplete(); + handle |= handleContent | handleRequest; + } + + return result; + } + return null; + } + private HttpInput.Content newContent(Stream.Data data) { return new DataContent(data); 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 f7be7daf52f..25b3c09967d 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 @@ -596,7 +596,7 @@ public class QuicheConnection if (written == LibQuiche.quiche_error.QUICHE_ERR_DONE) return; if (written < 0L) - throw new IOException(" failed to write FIN to stream " + streamId + "; err=" + LibQuiche.quiche_error.errToString(written)); + throw new IOException("failed to write FIN to stream " + streamId + "; err=" + LibQuiche.quiche_error.errToString(written)); } } diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java index b487a4450cf..1a81c557b26 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java @@ -92,14 +92,14 @@ public class HttpClientLoadTest extends AbstractTest IntStream.range(0, runs).forEach(j -> - run(iterations))); + run(transport, iterations))); } - private void run(int iterations) + private void run(Transport transport, int iterations) { CountDownLatch latch = new CountDownLatch(iterations); List failures = new ArrayList<>(); @@ -173,7 +173,7 @@ public class HttpClientLoadTest extends AbstractTest 0 ? iterations * 1000L / elapsed : -1); + logger.info("{} {} requests in {} ms, {} req/s", iterations, transport, elapsed, elapsed > 0 ? iterations * 1000L / elapsed : -1); for (String failure : failures) {