Skip to content

Commit 0c166b9

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 3b0ba88 commit 0c166b9

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/Http2ConnectionBase.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ void onStreamWritabilityChanged(Http2Stream s) {
142142
void onStreamClosed(Http2Stream s) {
143143
VertxHttp2Stream stream = s.getProperty(streamKey);
144144
if (stream != null) {
145-
boolean active = chctx.channel().isActive();
146-
if (goAwayStatus != null) {
147-
stream.onException(new HttpClosedException(goAwayStatus));
148-
} else if (!active) {
149-
stream.onException(HttpUtils.STREAM_CLOSED_EXCEPTION);
150-
}
145+
// boolean active = chctx.channel().isActive();
146+
// if (goAwayStatus != null) {
147+
// stream.onException(new HttpClosedException(goAwayStatus));
148+
// } else if (!active) {
149+
// stream.onException(HttpUtils.STREAM_CLOSED_EXCEPTION);
150+
// }
151151
stream.onClose();
152152
}
153153
}
@@ -203,7 +203,7 @@ public void onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDe
203203

204204
@Override
205205
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endOfStream) throws Http2Exception {
206-
if (goAwayStatus == null) {
206+
if (goAwayStatus == null || endOfStream) {
207207
StreamPriority streamPriority = new StreamPriority()
208208
.setDependency(streamDependency)
209209
.setWeight(weight)
@@ -214,7 +214,7 @@ public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers
214214

215215
@Override
216216
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endOfStream) throws Http2Exception {
217-
if (goAwayStatus == null) {
217+
if (goAwayStatus == null || endOfStream) {
218218
onHeadersRead(streamId, headers, null, endOfStream);
219219
}
220220
}

0 commit comments

Comments
 (0)