Skip to content

Commit 9aead5d

Browse files
committed
Fix a regression introduced after the MYR patch.
Motivation: The MYR patches conservatively ignores any header frame when the go away status is not null, which prevents receiving end headers frame. We should only guard against the requests. Changes: Dispatch headers ending frames.
1 parent 93d13cd commit 9aead5d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

vertx-core/src/main/java/io/vertx/core/http/impl/http2/codec/Http2ConnectionImpl.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ void onStreamWritabilityChanged(Http2Stream s) {
147147
void onStreamClosed(Http2Stream s) {
148148
Http2StreamBase stream = s.getProperty(streamKey);
149149
if (stream != null) {
150-
boolean active = chctx.channel().isActive();
151-
if (goAwayStatus != null) {
152-
stream.onException(new HttpClosedException(goAwayStatus));
153-
} else if (!active) {
154-
stream.onException(HttpUtils.STREAM_CLOSED_EXCEPTION);
155-
}
150+
// boolean active = chctx.channel().isActive();
151+
// if (goAwayStatus != null) {
152+
// stream.onException(new HttpClosedException(goAwayStatus));
153+
// } else if (!active) {
154+
// stream.onException(HttpUtils.STREAM_CLOSED_EXCEPTION);
155+
// }
156156
stream.onClose();
157157
}
158158
}
@@ -208,7 +208,7 @@ public void onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDe
208208

209209
@Override
210210
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endOfStream) throws Http2Exception {
211-
if (goAwayStatus == null) {
211+
if (goAwayStatus == null || endOfStream) {
212212
StreamPriority streamPriority = new StreamPriority()
213213
.setDependency(streamDependency)
214214
.setWeight(weight)
@@ -219,7 +219,7 @@ public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers
219219

220220
@Override
221221
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endOfStream) throws Http2Exception {
222-
if (goAwayStatus == null) {
222+
if (goAwayStatus == null || endOfStream) {
223223
onHeadersRead(streamId, headers, null, endOfStream);
224224
}
225225
}

0 commit comments

Comments
 (0)