improve error message when closing a connection

fixes #228
This commit is contained in:
Lucas Clemente
2016-07-29 12:04:04 +02:00
parent 2d48210fa0
commit 7ab2eb1b93
3 changed files with 20 additions and 7 deletions

View File

@@ -417,8 +417,16 @@ func (s *Session) closeImpl(e error, remoteClose bool) error {
e = qerr.PeerGoingAway
}
utils.Errorf("Closing session with error: %s", e.Error())
s.closeStreamsWithError(e)
quicErr := qerr.ToQuicError(e)
// Don't log 'normal' reasons
if quicErr.ErrorCode == qerr.PeerGoingAway || quicErr.ErrorCode == qerr.NetworkIdleTimeout {
utils.Infof("Closing connection %x", s.connectionID)
} else {
utils.Errorf("Closing session with error: %s", e.Error())
}
s.closeStreamsWithError(quicErr)
s.closeCallback(s.connectionID)
if remoteClose {
@@ -427,7 +435,6 @@ func (s *Session) closeImpl(e error, remoteClose bool) error {
return nil
}
quicErr := qerr.ToQuicError(e)
if quicErr.ErrorCode == qerr.DecryptionFailure {
// If we send a public reset, don't send a CONNECTION_CLOSE
s.closeChan <- nil