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 2020/11/21 20:30:31 UTC

[httpcomponents-core] 03/03: Bug fix: corrected handling of pushed stream refusal by the HTTP/2 protocol handler

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit da5025f09dd4e8863884a73c4319f1afb1417ab8
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Nov 21 21:20:42 2020 +0100

    Bug fix: corrected handling of pushed stream refusal by the HTTP/2 protocol handler
---
 .../hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java
index a3961b2..67d5db2 100644
--- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java
+++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java
@@ -949,7 +949,7 @@ abstract class AbstractH2StreamMultiplexer implements Identifiable, HttpConnecti
                 } catch (final H2StreamResetException ex) {
                     promisedStream.localReset(ex);
                 } catch (final HttpStreamResetException ex) {
-                    stream.localReset(ex, ex.getCause() != null ? H2Error.INTERNAL_ERROR : H2Error.NO_ERROR);
+                    promisedStream.localReset(ex, ex.getCause() != null ? H2Error.INTERNAL_ERROR : H2Error.NO_ERROR);
                 }
             }
             break;
@@ -1008,12 +1008,12 @@ abstract class AbstractH2StreamMultiplexer implements Identifiable, HttpConnecti
         if (stream.isRemoteClosed()) {
             throw new H2StreamResetException(H2Error.STREAM_CLOSED, "Stream already closed");
         }
-        if (stream.isLocalReset()) {
-            return;
-        }
         if (frame.isFlagSet(FrameFlag.END_STREAM)) {
             stream.setRemoteEndStream();
         }
+        if (stream.isLocalReset()) {
+            return;
+        }
         stream.consumeData(payload);
     }