TUN-7480: Added a timeout for unregisterUDP.

I deliberately kept this as an unregistertimeout because that was the
intent. In the future we could change this to a UDPConnConfig if we want
to pass multiple values here.

The idea of this PR is simply to add a configurable unregister UDP
timeout.
This commit is contained in:
Sudarsan Reddy
2023-06-19 17:03:11 +01:00
parent a3bcf25fae
commit 1abd22ef0a
7 changed files with 96 additions and 15 deletions

View File

@@ -68,6 +68,8 @@ type TunnelConfig struct {
ProtocolSelector connection.ProtocolSelector
EdgeTLSConfigs map[connection.Protocol]*tls.Config
PacketConfig *ingress.GlobalRouterConfig
UDPUnregisterSessionTimeout time.Duration
}
func (c *TunnelConfig) registrationOptions(connectionID uint8, OriginLocalIP string, uuid uuid.UUID) *tunnelpogs.RegistrationOptions {
@@ -615,7 +617,9 @@ func (e *EdgeTunnelServer) serveQUIC(
connOptions,
controlStreamHandler,
connLogger.Logger(),
e.config.PacketConfig)
e.config.PacketConfig,
e.config.UDPUnregisterSessionTimeout,
)
if err != nil {
if e.config.NeedPQ {
handlePQTunnelError(err, e.config)