Skip to content

Commit

Permalink
alter the no op func
Browse files Browse the repository at this point in the history
  • Loading branch information
misvivek committed Nov 4, 2024
1 parent 55332ac commit 5ce3627
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/transport/http2_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1041,10 +1041,9 @@ func (t *http2Server) writeHeaderLocked(s *Stream) error {
}
return nil
}
func SignalDeadlineExceededForTesting() {
func SignalDeadlineExceededForTesting(rst bool, st *status.Status) {
if st.Code() == codes.DeadlineExceeded {
rst = true
setRstAndCallNoop(&rst)
}
}

Expand Down Expand Up @@ -1111,7 +1110,7 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error {
// Send a RST_STREAM after the trailers if the client has not already half-closed.
rst := s.getState() == streamActive

SignalDeadlineExceededForTesting()
SignalDeadlineExceededForTesting(rst, st)
t.finishStream(s, rst, http2.ErrCodeNo, trailingHeader, true)
for _, sh := range t.stats {
// Note: The trailer fields are compressed with hpack after this call returns.
Expand Down

0 comments on commit 5ce3627

Please sign in to comment.