Skip to content

Commit

Permalink
Update internal/transport/http2_client.go
Browse files Browse the repository at this point in the history
Co-authored-by: Arvind Bright <[email protected]>
  • Loading branch information
aranjans and arvindbr8 committed Apr 17, 2024
1 parent 0c6bc03 commit 5bd1e15
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/transport/http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1002,9 +1002,8 @@ func (t *http2Client) Close(err error) {
t.kpDormancyCond.Signal()
}
t.mu.Unlock()
// The HTTP/2 spec mentions that a GOAWAY frame should be sent before a connection close. If this close() function
// ever starts to take in an HTTP/2 error code the peer will be able to get more information about the reason
// behind the connection close.
// Per HTTP/2 spec, a GOAWAY frame must be sent before closing the
// connection. See https://httpwg.org/specs/rfc7540.html#GOAWAY.
t.controlBuf.put(&goAway{code: http2.ErrCodeNo, debugData: []byte(fmt.Sprintf("client shutdown with: %v", err)), closeConnErr: err})
if t.writerDone != nil {
<-t.writerDone
Expand Down

0 comments on commit 5bd1e15

Please sign in to comment.