You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2018/09/25 14:30:14 UTC

httpcomponents-core git commit: Include error code in the H2StreamResetException message

Repository: httpcomponents-core
Updated Branches:
  refs/heads/master 309e79ece -> 440406193


Include error code in the H2StreamResetException message


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/44040619
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/44040619
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/44040619

Branch: refs/heads/master
Commit: 4404061937715f8c8fb94d68397a131a55a3cc76
Parents: 309e79e
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Tue Sep 25 16:20:44 2018 +0200
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Tue Sep 25 16:20:51 2018 +0200

----------------------------------------------------------------------
 .../core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/44040619/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
----------------------------------------------------------------------
diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
index 1a151ef..9a0fd8e 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractHttp2StreamMultiplexer.java
@@ -853,7 +853,7 @@ abstract class AbstractHttp2StreamMultiplexer implements Identifiable, HttpConne
                         throw new H2ConnectionException(H2Error.FRAME_SIZE_ERROR, "Invalid RST_STREAM frame payload");
                     }
                     final int errorCode = payload.getInt();
-                    stream.reset(new H2StreamResetException(errorCode, "Stream reset"));
+                    stream.reset(new H2StreamResetException(errorCode, "Stream reset (" + errorCode + ")"));
                     streamMap.remove(streamId);
                     stream.releaseResources();
                 }
@@ -961,7 +961,7 @@ abstract class AbstractHttp2StreamMultiplexer implements Identifiable, HttpConne
                 }
                 final ByteBuffer payload = frame.getPayload();
                 if (payload == null || payload.remaining() < 8) {
-                    throw new H2ConnectionException(H2Error.FRAME_SIZE_ERROR, "Invalid RST_STREAM payload");
+                    throw new H2ConnectionException(H2Error.FRAME_SIZE_ERROR, "Invalid GOAWAY payload");
                 }
                 final int processedLocalStreamId = payload.getInt();
                 final int errorCode = payload.getInt();
@@ -982,7 +982,7 @@ abstract class AbstractHttp2StreamMultiplexer implements Identifiable, HttpConne
                     for (final Iterator<Map.Entry<Integer, Http2Stream>> it = streamMap.entrySet().iterator(); it.hasNext(); ) {
                         final Map.Entry<Integer, Http2Stream> entry = it.next();
                         final Http2Stream stream = entry.getValue();
-                        stream.reset(new H2StreamResetException(errorCode, "Connection terminated by the peer"));
+                        stream.reset(new H2StreamResetException(errorCode, "Connection terminated by the peer (" + errorCode + ")"));
                     }
                     streamMap.clear();
                     connState = ConnectionHandshake.SHUTDOWN;