Skip to content

Commit

Permalink
refactor: clarify filter func return val meaning
Browse files Browse the repository at this point in the history
  • Loading branch information
WofWca committed Nov 24, 2024
1 parent 7c76e09 commit e77b481
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions settingengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -201,15 +201,15 @@ 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
}

// SetIPFilter sets the filtering functions when gathering ICE candidates
// 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
}

Expand Down

0 comments on commit e77b481

Please sign in to comment.