Skip to content

Commit ed066c8

Browse files
fraenkelbradfitz
authored andcommitted
http2: Revert a closed stream cannot receive data
This reverts CL 111676 for golang/go#25023. Reason for revert: The code change no longer issued a WindowUpdate which is required when processing data. The original issue found in golang/go#25023 is not present after the revert. Updates golang/go#28204 Change-Id: Iadbb63d50ca06df1281e699b9ef13181d0593f80 Reviewed-on: https://go-review.googlesource.com/c/153977 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 915654e commit ed066c8

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

http2/server.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,12 +1594,6 @@ func (sc *serverConn) processData(f *DataFrame) error {
15941594
// type PROTOCOL_ERROR."
15951595
return ConnectionError(ErrCodeProtocol)
15961596
}
1597-
// RFC 7540, sec 6.1: If a DATA frame is received whose stream is not in
1598-
// "open" or "half-closed (local)" state, the recipient MUST respond with a
1599-
// stream error (Section 5.4.2) of type STREAM_CLOSED.
1600-
if state == stateClosed {
1601-
return streamError(id, ErrCodeStreamClosed)
1602-
}
16031597
if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued {
16041598
// This includes sending a RST_STREAM if the stream is
16051599
// in stateHalfClosedLocal (which currently means that

http2/server_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,6 +2361,9 @@ func TestServer_NoCrash_HandlerClose_Then_ClientClose(t *testing.T) {
23612361
// it did before.
23622362
st.writeData(1, true, []byte("foo"))
23632363

2364+
// Get our flow control bytes back, since the handler didn't get them.
2365+
st.wantWindowUpdate(0, uint32(len("foo")))
2366+
23642367
// Sent after a peer sends data anyway (admittedly the
23652368
// previous RST_STREAM might've still been in-flight),
23662369
// but they'll get the more friendly 'cancel' code

0 commit comments

Comments
 (0)