@@ -668,7 +668,6 @@ func (h *Hub) ConnectToServer(channel string, force bool, host *HostInfo) (err e
} else if host.Version == tcp2.VERSION && host.Proto == tcp2.PROTO {
runProto = tcp2.PROTO
conn, err = tcp2.Dial(h.cf, addr, host.Hash)
-
} else {
err = fmt.Errorf("not correct protocol and version found in: %+v", host)
}
@@ -139,7 +139,9 @@ func (h *HostInfo) String() string {
b.WriteString(h.Host)
- b.WriteString(fmt.Sprintf(":%d", h.Port))
+ if h.Port > 0 {
+ b.WriteString(fmt.Sprintf(":%d", h.Port))
+ }
if h.Path != "" {
b.WriteString(h.Path)