From 732277c002dc10e2b6a6f45476a5994518dc399b Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Tue, 17 Jan 2017 18:37:05 +0100 Subject: [PATCH] Converted IOException to EofException in case of client close or reset. It's common for a client to either close the connection or reset a stream, so EofException is a better exception to report since it will be logged at DEBUG level by the server, reducing the noise in the logs. --- .../jetty/http2/server/HTTP2ServerConnectionFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnectionFactory.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnectionFactory.java index 0f251a95ecd..c64ad7b1599 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnectionFactory.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HTTP2ServerConnectionFactory.java @@ -18,7 +18,6 @@ package org.eclipse.jetty.http2.server; -import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeoutException; @@ -36,6 +35,7 @@ import org.eclipse.jetty.http2.frames.PushPromiseFrame; import org.eclipse.jetty.http2.frames.ResetFrame; import org.eclipse.jetty.http2.frames.SettingsFrame; import org.eclipse.jetty.io.EndPoint; +import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.NegotiatingServerConnection.CipherDiscriminator; @@ -131,7 +131,7 @@ public class HTTP2ServerConnectionFactory extends AbstractHTTP2ServerConnectionF String reason = frame.tryConvertPayload(); if (reason != null && !reason.isEmpty()) reason = " (" + reason + ")"; - getConnection().onSessionFailure(new IOException("HTTP/2 " + error + reason)); + getConnection().onSessionFailure(new EofException("HTTP/2 " + error + reason)); } @Override @@ -167,7 +167,7 @@ public class HTTP2ServerConnectionFactory extends AbstractHTTP2ServerConnectionF ErrorCode error = ErrorCode.from(frame.getError()); if (error == null) error = ErrorCode.CANCEL_STREAM_ERROR; - getConnection().onStreamFailure((IStream)stream, new IOException("HTTP/2 " + error)); + getConnection().onStreamFailure((IStream)stream, new EofException("HTTP/2 " + error)); } @Override