mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Restructure a bit based on review
This commit is contained in:
parent
846473b354
commit
1220853a67
1 changed files with 3 additions and 10 deletions
|
@ -104,17 +104,10 @@ func stripLocalAddresses(str string) string {
|
||||||
for _, a := range m.Attributes {
|
for _, a := range m.Attributes {
|
||||||
if a.IsICECandidate() {
|
if a.IsICECandidate() {
|
||||||
ice, err := a.ToICECandidate()
|
ice, err := a.ToICECandidate()
|
||||||
if err != nil {
|
if err == nil && ice.Typ == "host" {
|
||||||
attrs = append(attrs, a)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if ice.Typ == "host" {
|
|
||||||
ip := net.ParseIP(ice.Address)
|
ip := net.ParseIP(ice.Address)
|
||||||
if ip == nil {
|
if ip != nil && (IsLocal(ip) || ip.IsUnspecified() || ip.IsLoopback()) {
|
||||||
attrs = append(attrs, a)
|
/* no append in this case */
|
||||||
continue
|
|
||||||
}
|
|
||||||
if IsLocal(ip) || ip.IsUnspecified() || ip.IsLoopback() {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue