X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=ipport.go;h=a85a97fc10422229ba7cdaececd7fbe5d4b5abbc;hb=963c0e0f3299ce47fc44cda8b9dead59ff7eea2b;hp=9fe9e42d80e5df97d524d26fa632be72b2b9cb8f;hpb=8e2139b33597b0565bdffcb5b51692d36b3af0b8;p=btrtrc.git diff --git a/ipport.go b/ipport.go index 9fe9e42d..a85a97fc 100644 --- a/ipport.go +++ b/ipport.go @@ -13,13 +13,14 @@ func addrPortOrZero(addr net.Addr) int { case *net.TCPAddr: return raw.Port default: + // Consider a unix socket on Windows with a name like "C:notanint". _, port, err := net.SplitHostPort(addr.String()) if err != nil { return 0 } i64, err := strconv.ParseUint(port, 0, 16) if err != nil { - panic(err) + return 0 } return int(i64) }