transport: http2Client sends RST_STREAM (#2354)

If http2Client receives END_STREAM before it sends END_STREAM, it will send RST_STREAM to fully closed the stream.
This commit is contained in:
Andrew Seigner 2018-10-15 14:28:12 -07:00 committed by Menghan Li
parent f1b28afd42
commit 1da8e51941
1 changed files with 3 additions and 1 deletions

View File

@ -1173,7 +1173,9 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) {
if !endStream { if !endStream {
return return
} }
t.closeStream(s, io.EOF, false, http2.ErrCodeNo, state.status(), state.mdata, true) // if client received END_STREAM from server while stream was still active, send RST_STREAM
rst := s.getState() == streamActive
t.closeStream(s, io.EOF, rst, http2.ErrCodeNo, state.status(), state.mdata, true)
} }
// reader runs as a separate goroutine in charge of reading data from network // reader runs as a separate goroutine in charge of reading data from network