From b8fcf99aa0ee6107d5cf02b09af174fa821c243c Mon Sep 17 00:00:00 2001 From: Stephan Rotolante Date: Wed, 3 Apr 2024 00:23:50 -0400 Subject: [PATCH] Expose STUNGatherTimeout via SettingEngine Resolves pion/webrtc#2668 --- go.mod | 2 +- go.sum | 4 ++-- icegatherer.go | 1 + settingengine.go | 6 ++++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e266e39ed7..adf3b575a4 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/pion/datachannel v1.5.6 github.com/pion/dtls/v2 v2.2.10 - github.com/pion/ice/v3 v3.0.4 + github.com/pion/ice/v3 v3.0.5 github.com/pion/interceptor v0.1.27 github.com/pion/logging v0.2.2 github.com/pion/randutil v0.1.0 diff --git a/go.sum b/go.sum index e3c5c6a46b..3efbb8abb6 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/pion/datachannel v1.5.6/go.mod h1:1eKT6Q85pRnr2mHiWHxJwO50SfZRtWHTsNI github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s= github.com/pion/dtls/v2 v2.2.10 h1:u2Axk+FyIR1VFTPurktB+1zoEPGIW3bmyj3LEFrXjAA= github.com/pion/dtls/v2 v2.2.10/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= -github.com/pion/ice/v3 v3.0.4 h1:TqEdK0nWHm3vs76Rvgd7dpDKhGzagtZ7u+kt0b9ed/s= -github.com/pion/ice/v3 v3.0.4/go.mod h1:GIQiugpGkBDvh18nhFLRoHgabZ9VSRJOaEPh1nHjdrs= +github.com/pion/ice/v3 v3.0.5 h1:V6tNvpGS/vNJBWh3BEzQrwiPncOmLx7jbbSJM/2PFHE= +github.com/pion/ice/v3 v3.0.5/go.mod h1:GIQiugpGkBDvh18nhFLRoHgabZ9VSRJOaEPh1nHjdrs= github.com/pion/interceptor v0.1.27 h1:mZ01OiGiukwRxezmDGzYjjokCVlDOk4T6BfaL5qrtGo= github.com/pion/interceptor v0.1.27/go.mod h1:/vVaqLwDjGv4GRbgmChIKZIT5EXFDijwmj4WmIYy9bI= github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= diff --git a/icegatherer.go b/icegatherer.go index 76e16ce3ba..51ea1aff79 100644 --- a/icegatherer.go +++ b/icegatherer.go @@ -108,6 +108,7 @@ func (g *ICEGatherer) createAgent() error { SrflxAcceptanceMinWait: g.api.settingEngine.timeout.ICESrflxAcceptanceMinWait, PrflxAcceptanceMinWait: g.api.settingEngine.timeout.ICEPrflxAcceptanceMinWait, RelayAcceptanceMinWait: g.api.settingEngine.timeout.ICERelayAcceptanceMinWait, + STUNGatherTimeout: g.api.settingEngine.timeout.ICESTUNGatherTimeout, InterfaceFilter: g.api.settingEngine.candidates.InterfaceFilter, IPFilter: g.api.settingEngine.candidates.IPFilter, NAT1To1IPs: g.api.settingEngine.candidates.NAT1To1IPs, diff --git a/settingengine.go b/settingengine.go index f121d050b6..ef0d9bea04 100644 --- a/settingengine.go +++ b/settingengine.go @@ -41,6 +41,7 @@ type SettingEngine struct { ICESrflxAcceptanceMinWait *time.Duration ICEPrflxAcceptanceMinWait *time.Duration ICERelayAcceptanceMinWait *time.Duration + ICESTUNGatherTimeout *time.Duration } candidates struct { ICELite bool @@ -157,6 +158,11 @@ func (e *SettingEngine) SetRelayAcceptanceMinWait(t time.Duration) { e.timeout.ICERelayAcceptanceMinWait = &t } +// SetSTUNGatherTimeout sets the ICESTUNGatherTimeout +func (e *SettingEngine) SetSTUNGatherTimeout(t time.Duration) { + e.timeout.ICESTUNGatherTimeout = &t +} + // SetEphemeralUDPPortRange limits the pool of ephemeral ports that // ICE UDP connections can allocate from. This affects both host candidates, // and the local address of server reflexive candidates.