File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ func (ye *Error) Temporary() bool {
2424}
2525
2626type GoAwayError struct {
27- Remote bool
2827 ErrorCode uint32
28+ Remote bool
2929}
3030
3131func (e * GoAwayError ) Error () string {
Original file line number Diff line number Diff line change @@ -536,13 +536,14 @@ func (s *Session) send() {
536536 if err := s .sendLoop (); err != nil {
537537 // Prefer the recvLoop error over the sendLoop error. The receive loop might have the error code
538538 // received in a GoAway frame received just before the TCP RST that closed the sendLoop
539- //
540- // Take the shutdownLock to avoid closing the connection concurrently with a Close call.
541539 s .shutdownLock .Lock ()
542- s .conn .Close ()
543- <- s .recvDoneCh
544- if _ , ok := s .recvErr .(* GoAwayError ); ok {
545- err = s .recvErr
540+ if s .shutdownErr == nil {
541+ s .conn .Close ()
542+ <- s .recvDoneCh
543+ if _ , ok := s .recvErr .(* GoAwayError ); ok {
544+ err = s .recvErr
545+ }
546+ s .shutdownErr = err
546547 }
547548 s .shutdownLock .Unlock ()
548549 s .close (err , false , 0 )
You can’t perform that action at this time.
0 commit comments