[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake/master] Restructure a bit based on review



commit 1220853a67c8bd09c171c49097944e120ab8c9d4
Author: Arlo Breault <arlolra@xxxxxxxxx>
Date:   Fri Feb 7 19:02:53 2020 -0500

    Restructure a bit based on review
---
 client/lib/rendezvous.go | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/client/lib/rendezvous.go b/client/lib/rendezvous.go
index 190df66..17c024f 100644
--- a/client/lib/rendezvous.go
+++ b/client/lib/rendezvous.go
@@ -104,17 +104,10 @@ func stripLocalAddresses(str string) string {
 		for _, a := range m.Attributes {
 			if a.IsICECandidate() {
 				ice, err := a.ToICECandidate()
-				if err != nil {
-					attrs = append(attrs, a)
-					continue
-				}
-				if ice.Typ == "host" {
+				if err == nil && ice.Typ == "host" {
 					ip := net.ParseIP(ice.Address)
-					if ip == nil {
-						attrs = append(attrs, a)
-						continue
-					}
-					if IsLocal(ip) || ip.IsUnspecified() || ip.IsLoopback() {
+					if ip != nil && (IsLocal(ip) || ip.IsUnspecified() || ip.IsLoopback()) {
+						/* no append in this case */
 						continue
 					}
 				}

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits