From e77b4811e7fa32cca49731be577b024d39c798b3 Mon Sep 17 00:00:00 2001 From: WofWca Date: Mon, 25 Nov 2024 00:58:55 +0400 Subject: [PATCH] refactor: clarify filter func return val meaning --- settingengine.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/settingengine.go b/settingengine.go index 2e37b4e74e0..5fcafeb7615 100644 --- a/settingengine.go +++ b/settingengine.go @@ -48,8 +48,8 @@ type SettingEngine struct { candidates struct { ICELite bool ICENetworkTypes []NetworkType - InterfaceFilter func(string) bool - IPFilter func(net.IP) bool + InterfaceFilter func(string) (keep bool) + IPFilter func(net.IP) (keep bool) NAT1To1IPs []string NAT1To1IPCandidateType ICECandidateType MulticastDNSMode ice.MulticastDNSMode @@ -201,7 +201,7 @@ func (e *SettingEngine) SetNetworkTypes(candidateTypes []NetworkType) { // This can be used to exclude certain network interfaces from ICE. Which may be // useful if you know a certain interface will never succeed, or if you wish to reduce // the amount of information you wish to expose to the remote peer -func (e *SettingEngine) SetInterfaceFilter(filter func(string) bool) { +func (e *SettingEngine) SetInterfaceFilter(filter func(string) (keep bool)) { e.candidates.InterfaceFilter = filter } @@ -209,7 +209,7 @@ func (e *SettingEngine) SetInterfaceFilter(filter func(string) bool) { // This can be used to exclude certain ip from ICE. Which may be // useful if you know a certain ip will never succeed, or if you wish to reduce // the amount of information you wish to expose to the remote peer -func (e *SettingEngine) SetIPFilter(filter func(net.IP) bool) { +func (e *SettingEngine) SetIPFilter(filter func(net.IP) (keep bool)) { e.candidates.IPFilter = filter }