generate new connection ID after version negotiation

fixes #404
This commit is contained in:
Marten Seemann
2017-02-06 15:42:37 +07:00
parent 268841f0cc
commit 35242394e1
2 changed files with 8 additions and 1 deletions

View File

@@ -175,9 +175,14 @@ func (c *Client) handlePacket(packet []byte) error {
return qerr.VersionNegotiationMismatch
}
utils.Infof("Switching to QUIC version %d", highestSupportedVersion)
// switch to negotiated version
c.version = highestSupportedVersion
c.versionNegotiated = true
c.connectionID, err = utils.GenerateConnectionID()
if err != nil {
return err
}
utils.Infof("Switching to QUIC version %d. New connection ID: %x", highestSupportedVersion, c.connectionID)
c.session.Close(errCloseSessionForNewVersion)
err = c.createNewSession(hdr.SupportedVersions)