Skip to content

Commit

Permalink
only send goaway on close
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Sep 4, 2024
1 parent 8adb9a8 commit 5727def
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion const.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const (
// It's not an implementation choice, the value defined in the specification.
initialStreamWindow = 256 * 1024
maxStreamWindow = 16 * 1024 * 1024
goAwayWaitTime = 5 * time.Second
goAwayWaitTime = 100 * time.Millisecond
)

const (
Expand Down
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (s *Session) AcceptStream() (*Stream, error) {
// semantics of the underlying net.Conn. For TCP connections, it may be dropped depending on LINGER value or
// if there's unread data in the kernel receive buffer.
func (s *Session) Close() error {
return s.close(ErrSessionShutdown, true, goAwayNormal)
return s.close(ErrSessionShutdown, false, goAwayNormal)
}

// CloseWithError is used to close the session and all streams after sending a GoAway message with errCode.
Expand Down

0 comments on commit 5727def

Please sign in to comment.