From ce4bb35e979800eb3f8c2cf75b8c1567f840d4d2 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 27 Nov 2020 13:45:28 +0100 Subject: [PATCH] Fixed failAllData() logic to return true if the stream is already remotely closed. Signed-off-by: Simone Bordet --- .../src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java index 952e7f20afd..97701709e7f 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java @@ -248,7 +248,9 @@ public class HTTP2Stream extends IdleTimeout implements IStream, Callback, Dumpa } copy.forEach(dataEntry -> dataEntry.callback.failed(x)); DataEntry lastDataEntry = copy.isEmpty() ? null : copy.get(copy.size() - 1); - return lastDataEntry != null && lastDataEntry.frame.isEndStream(); + if (lastDataEntry == null) + return isRemotelyClosed(); + return lastDataEntry.frame.isEndStream(); } public boolean isLocallyClosed()