fix error handling when receiving post handshake messages

This commit is contained in:
Marten Seemann
2020-09-28 10:47:36 +07:00
parent ebe051b2cc
commit 6ad29e721e

View File

@@ -499,7 +499,11 @@ func (h *cryptoSetup) handlePostHandshakeMessage() {
}()
if err := h.conn.HandlePostHandshakeMessage(); err != nil {
h.onError(<-alertChan, err.Error())
select {
case <-h.closeChan:
case alert := <-alertChan:
h.onError(alert, err.Error())
}
}
}