From d724208a20c525ab6688b46d7f10e6cb2ef6a458 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 12 Jan 2024 21:41:42 +0100 Subject: [PATCH] Updates after review. Signed-off-by: Simone Bordet --- .../java/org/eclipse/jetty/http2/HTTP2Session.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/jetty-core/jetty-http2/jetty-http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java b/jetty-core/jetty-http2/jetty-http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java index 3a5552cc125e..0b0a753d2495 100644 --- a/jetty-core/jetty-http2/jetty-http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java +++ b/jetty-core/jetty-http2/jetty-http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java @@ -1935,7 +1935,7 @@ private boolean onIdleTimeout() goAwayFrame = goAwaySent; closed = CloseState.CLOSING; zeroStreamsAction = null; - failure = cause = new TimeoutException("Session idle timeout expired"); + failure = cause = newTimeoutException(); } case REMOTELY_CLOSED -> { @@ -1944,7 +1944,7 @@ private boolean onIdleTimeout() goAwayFrame = goAwaySent; closed = CloseState.CLOSING; zeroStreamsAction = null; - failure = cause = new TimeoutException("Session idle timeout expired"); + failure = cause = newTimeoutException(); } default -> terminate = true; } @@ -1955,7 +1955,7 @@ private boolean onIdleTimeout() if (LOG.isDebugEnabled()) LOG.debug("Already closed, ignored idle timeout for {}", HTTP2Session.this); // Writes may be TCP congested, so termination never happened. - flusher.abort(new TimeoutException()); + flusher.abort(newTimeoutException()); return false; } @@ -1977,6 +1977,11 @@ private boolean onIdleTimeout() return false; } + private TimeoutException newTimeoutException() + { + return new TimeoutException("Session idle timeout expired"); + } + private void onSessionFailure(int error, String reason, Callback callback) { GoAwayFrame goAwayFrame;