mirror of
https://github.com/golang/net.git
synced 2026-03-31 10:27:08 +09:00
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 <bradfitz@golang.org>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
915654e7ea
commit
ed066c81e7
@@ -1594,12 +1594,6 @@ func (sc *serverConn) processData(f *DataFrame) error {
|
||||
// type PROTOCOL_ERROR."
|
||||
return ConnectionError(ErrCodeProtocol)
|
||||
}
|
||||
// RFC 7540, sec 6.1: If a DATA frame is received whose stream is not in
|
||||
// "open" or "half-closed (local)" state, the recipient MUST respond with a
|
||||
// stream error (Section 5.4.2) of type STREAM_CLOSED.
|
||||
if state == stateClosed {
|
||||
return streamError(id, ErrCodeStreamClosed)
|
||||
}
|
||||
if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued {
|
||||
// This includes sending a RST_STREAM if the stream is
|
||||
// in stateHalfClosedLocal (which currently means that
|
||||
|
||||
@@ -2361,6 +2361,9 @@ func TestServer_NoCrash_HandlerClose_Then_ClientClose(t *testing.T) {
|
||||
// it did before.
|
||||
st.writeData(1, true, []byte("foo"))
|
||||
|
||||
// Get our flow control bytes back, since the handler didn't get them.
|
||||
st.wantWindowUpdate(0, uint32(len("foo")))
|
||||
|
||||
// Sent after a peer sends data anyway (admittedly the
|
||||
// previous RST_STREAM might've still been in-flight),
|
||||
// but they'll get the more friendly 'cancel' code
|
||||
|
||||
Reference in New Issue
Block a user