forked from quic-go/quic-go
wait until the handshake is complete before updating the connection ID
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
type connIDManager struct {
|
||||
queue utils.NewConnectionIDList
|
||||
|
||||
handshakeComplete bool
|
||||
activeSequenceNumber uint64
|
||||
highestRetired uint64
|
||||
activeConnectionID protocol.ConnectionID
|
||||
@@ -190,7 +191,10 @@ func (h *connIDManager) SentPacket() {
|
||||
}
|
||||
|
||||
func (h *connIDManager) shouldUpdateConnID() bool {
|
||||
// initiate the first change as early as possible
|
||||
if !h.handshakeComplete {
|
||||
return false
|
||||
}
|
||||
// initiate the first change as early as possible (after handshake completion)
|
||||
if h.queue.Len() > 0 && h.activeSequenceNumber == 0 {
|
||||
return true
|
||||
}
|
||||
@@ -207,3 +211,7 @@ func (h *connIDManager) Get() protocol.ConnectionID {
|
||||
}
|
||||
return h.activeConnectionID
|
||||
}
|
||||
|
||||
func (h *connIDManager) SetHandshakeComplete() {
|
||||
h.handshakeComplete = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user