forked from quic-go/quic-go
use different source and destination connection IDs
This commit is contained in:
@@ -12,7 +12,7 @@ type ConnectionID []byte
|
||||
|
||||
// GenerateConnectionID generates a connection ID using cryptographic random
|
||||
func GenerateConnectionID() (ConnectionID, error) {
|
||||
b := make([]byte, 8)
|
||||
b := make([]byte, ConnectionIDLen)
|
||||
if _, err := rand.Read(b); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -137,3 +137,9 @@ const MinStreamFrameSize ByteCount = 128
|
||||
// If the packet packing frequency is higher, multiple packets might be sent at once.
|
||||
// Example: For a packet pacing delay of 20 microseconds, we would send 5 packets at once, wait for 100 microseconds, and so forth.
|
||||
const MinPacingDelay time.Duration = 100 * time.Microsecond
|
||||
|
||||
// ConnectionIDLen is the length of the source Connection ID used on IETF QUIC packets.
|
||||
// The Short Header contains the connection ID, but not the length,
|
||||
// so we need to know this value in advance (or encode it into the connection ID).
|
||||
// TODO: make this configurable
|
||||
const ConnectionIDLen = 8
|
||||
|
||||
Reference in New Issue
Block a user