From 6f750d74841a501f010da6c7cd79ee6ac74b6dfd Mon Sep 17 00:00:00 2001 From: Julien Viet Date: Tue, 10 Dec 2024 09:34:21 +0100 Subject: [PATCH] Complete H2 reset promise as soon as the reset frame has been sent. Motivation: The recent changes in HTTP reset API introduced a returned future to signal when the stream reset is performed. The implementation completes the future when the stream reset has been written, instead we should complete it as soon as the frame is written. Changes: Complete the H2 reset future after the reset frame has been written. --- .../main/java/io/vertx/core/http/impl/VertxHttp2Stream.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vertx-core/src/main/java/io/vertx/core/http/impl/VertxHttp2Stream.java b/vertx-core/src/main/java/io/vertx/core/http/impl/VertxHttp2Stream.java index c3f6c1da462..b463956f13f 100644 --- a/vertx-core/src/main/java/io/vertx/core/http/impl/VertxHttp2Stream.java +++ b/vertx-core/src/main/java/io/vertx/core/http/impl/VertxHttp2Stream.java @@ -325,12 +325,12 @@ protected void doWriteReset(long code, Promise promise) { streamId = stream != null ? stream.id() : -1; } if (streamId != -1) { - conn.handler.writeReset(streamId, code, (PromiseInternal) promise); + conn.handler.writeReset(streamId, code, null); } else { // Reset happening before stream allocation handleReset(code); - promise.complete(); } + promise.complete(); } void handleWriteQueueDrained() {