mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
only use the conn ID backwards compatibility mode with draft-29
This commit is contained in:
parent
73193b7425
commit
e1f56127df
5 changed files with 22 additions and 2 deletions
|
@ -22,6 +22,8 @@ type connIDGenerator struct {
|
|||
retireConnectionID func(protocol.ConnectionID)
|
||||
replaceWithClosed func(protocol.ConnectionID, packetHandler)
|
||||
queueControlFrame func(wire.Frame)
|
||||
|
||||
version protocol.VersionNumber
|
||||
}
|
||||
|
||||
func newConnIDGenerator(
|
||||
|
@ -33,6 +35,7 @@ func newConnIDGenerator(
|
|||
retireConnectionID func(protocol.ConnectionID),
|
||||
replaceWithClosed func(protocol.ConnectionID, packetHandler),
|
||||
queueControlFrame func(wire.Frame),
|
||||
version protocol.VersionNumber,
|
||||
) *connIDGenerator {
|
||||
m := &connIDGenerator{
|
||||
connIDLen: initialConnectionID.Len(),
|
||||
|
@ -43,6 +46,7 @@ func newConnIDGenerator(
|
|||
retireConnectionID: retireConnectionID,
|
||||
replaceWithClosed: replaceWithClosed,
|
||||
queueControlFrame: queueControlFrame,
|
||||
version: version,
|
||||
}
|
||||
m.activeSrcConnIDs[0] = initialConnectionID
|
||||
m.initialClientDestConnID = initialClientDestConnID
|
||||
|
@ -76,7 +80,7 @@ func (m *connIDGenerator) Retire(seq uint64, sentWithDestConnID protocol.Connect
|
|||
if !ok {
|
||||
return nil
|
||||
}
|
||||
if connID.Equal(sentWithDestConnID) && !RetireBugBackwardsCompatibilityMode {
|
||||
if connID.Equal(sentWithDestConnID) && !protocol.UseRetireBugBackwardsCompatibilityMode(RetireBugBackwardsCompatibilityMode, m.version) {
|
||||
return qerr.NewError(qerr.ProtocolViolation, fmt.Sprintf("tried to retire connection ID %d (%s), which was used as the Destination Connection ID on this packet", seq, connID))
|
||||
}
|
||||
m.retireConnectionID(connID)
|
||||
|
@ -89,7 +93,7 @@ func (m *connIDGenerator) Retire(seq uint64, sentWithDestConnID protocol.Connect
|
|||
}
|
||||
|
||||
func (m *connIDGenerator) issueNewConnID() error {
|
||||
if RetireBugBackwardsCompatibilityMode {
|
||||
if protocol.UseRetireBugBackwardsCompatibilityMode(RetireBugBackwardsCompatibilityMode, m.version) {
|
||||
return nil
|
||||
}
|
||||
connID, err := protocol.GenerateConnectionID(m.connIDLen)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue