immediately remove sessions that were closed remotely

We only need to keep sessions that were closed locally, in order to
retransmit the CONNECTION_CLOSE packet. For sessions that were closed by
the peer, we don't need to wait for any more packets, and there's also
no CONNECTION_CLOSE to retransmit. The same applies for sessions that
were destroyed when receiving a Version Negotiation or a Retry packet.
This commit is contained in:
Marten Seemann
2018-11-15 19:14:34 +07:00
parent 1dd0b9a635
commit 65cca7b726
8 changed files with 46 additions and 4 deletions

View File

@@ -407,6 +407,7 @@ func (c *client) createNewTLSSession(version protocol.VersionNumber) error {
runner := &runner{
onHandshakeCompleteImpl: func(_ Session) { close(c.handshakeChan) },
retireConnectionIDImpl: c.packetHandlers.Retire,
removeConnectionIDImpl: c.packetHandlers.Remove,
}
sess, err := newClientSession(
c.conn,