Skip to content

Commit

Permalink
server: send RST_STREAM after trailers if client has not half-closed
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley committed Mar 13, 2019
1 parent 9c3a959 commit cac76c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/transport/http2_server.go
Expand Up @@ -840,7 +840,9 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error {
t.closeStream(s, true, http2.ErrCodeInternal, nil, false)
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 {
t.stats.HandleRPC(s.Context(), &stats.OutTrailer{})
}
Expand Down

0 comments on commit cac76c4

Please sign in to comment.