Joyit 1 kuukausi sitten
vanhempi
sitoutus
f52aa6b827
2 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 0 1
      hub.go
  2. 3 1
      type.go

+ 0 - 1
hub.go

@@ -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)
 		}

+ 3 - 1
type.go

@@ -139,7 +139,9 @@ func (h *HostInfo) String() string {
 	} else {
 		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)
 	}