improve logging of handshake messages

This commit is contained in:
Marten Seemann
2019-11-25 09:09:34 +07:00
parent dde21d2f72
commit d0a3eaa8a3
2 changed files with 7 additions and 3 deletions

View File

@@ -288,14 +288,19 @@ func (h *cryptoSetup) HandleMessage(data []byte, encLevel protocol.EncryptionLev
if encLevel == protocol.Encryption1RTT {
h.handlePostHandshakeMessage()
}
var strFinished bool
switch h.perspective {
case protocol.PerspectiveClient:
return h.handleMessageForClient(msgType)
strFinished = h.handleMessageForClient(msgType)
case protocol.PerspectiveServer:
return h.handleMessageForServer(msgType)
strFinished = h.handleMessageForServer(msgType)
default:
panic("")
}
if strFinished {
h.logger.Debugf("Done with encryption level %s.", encLevel)
}
return strFinished
}
func (h *cryptoSetup) checkEncryptionLevel(msgType messageType, encLevel protocol.EncryptionLevel) error {

View File

@@ -873,7 +873,6 @@ func (s *session) handleCryptoFrame(frame *wire.CryptoFrame, encLevel protocol.E
if err != nil {
return err
}
s.logger.Debugf("Handled crypto frame at level %s. encLevelChanged: %t", encLevel, encLevelChanged)
if encLevelChanged {
s.tryDecryptingQueuedPackets()
}