mirror of
https://github.com/pion/webrtc.git
synced 2025-09-27 03:25:58 +08:00
Update SettingEngine to use named return values
The behavior of SetInterfaceFilter and SetIPFilter isn't obvious. Name the bool so the user understands the behavior from the function definition.
This commit is contained in:
@@ -48,8 +48,8 @@ type SettingEngine struct {
|
|||||||
candidates struct {
|
candidates struct {
|
||||||
ICELite bool
|
ICELite bool
|
||||||
ICENetworkTypes []NetworkType
|
ICENetworkTypes []NetworkType
|
||||||
InterfaceFilter func(string) bool
|
InterfaceFilter func(string) (keep bool)
|
||||||
IPFilter func(net.IP) bool
|
IPFilter func(net.IP) (keep bool)
|
||||||
NAT1To1IPs []string
|
NAT1To1IPs []string
|
||||||
NAT1To1IPCandidateType ICECandidateType
|
NAT1To1IPCandidateType ICECandidateType
|
||||||
MulticastDNSMode ice.MulticastDNSMode
|
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
|
// 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
|
// 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
|
// 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
|
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
|
// 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
|
// 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
|
// 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
|
e.candidates.IPFilter = filter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user