mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 20:59:58 +00:00
TUN-8667: Add datagram v3 session manager
New session manager leverages similar functionality that was previously provided with datagram v2, with the distinct difference that the sessions are registered via QUIC Datagrams and unregistered via timeouts only; the sessions will no longer attempt to unregister sessions remotely with the edge service. The Session Manager is shared across all QUIC connections that cloudflared uses to connect to the edge (typically 4). This will help cloudflared be able to monitor all sessions across the connections and help correlate in the future if sessions migrate across connections. The UDP payload size is still limited to 1280 bytes across all OS's. Any UDP packet that provides a payload size of greater than 1280 will cause cloudflared to report (as it currently does) a log error and drop the packet. Closes TUN-8667
This commit is contained in:
@@ -3,6 +3,7 @@ package v3
|
||||
import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -37,6 +38,10 @@ func RequestIDFromSlice(data []byte) (RequestID, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (id RequestID) String() string {
|
||||
return fmt.Sprintf("%016x%016x", id.hi, id.lo)
|
||||
}
|
||||
|
||||
// Compare returns an integer comparing two IPs.
|
||||
// The result will be 0 if id == id2, -1 if id < id2, and +1 if id > id2.
|
||||
// The definition of "less than" is the same as the [RequestID.Less] method.
|
||||
|
Reference in New Issue
Block a user