server: send RST_STREAM after trailers if client has not half-closed (#2684)

Fixes #834
This commit is contained in:
Doug Fawley
2019-03-14 15:15:50 -07:00
committed by GitHub
parent 2098091c81
commit 2d5c4dfb95

View File

@ -840,7 +840,9 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error {
t.closeStream(s, true, http2.ErrCodeInternal, nil, false) t.closeStream(s, true, http2.ErrCodeInternal, nil, false)
return ErrHeaderListSizeLimitViolation return ErrHeaderListSizeLimitViolation
} }
t.closeStream(s, false, 0, trailingHeader, true) // Send a RST_STREAM after the trailers if the client has not already half-closed.
rst := s.getState() == streamActive
t.closeStream(s, rst, http2.ErrCodeNo, trailingHeader, true)
if t.stats != nil { if t.stats != nil {
t.stats.HandleRPC(s.Context(), &stats.OutTrailer{}) t.stats.HandleRPC(s.Context(), &stats.OutTrailer{})
} }