gofmt
This commit is contained in:
1 parent
551c1d2925
commit
7d51f8751b
2 files changed
+7
-7
No files matched your search
+6
-6
@@ -31,7 +31,7 @@ type Router struct {
|
|||||||
ConnLimit int
|
ConnLimit int
|
||||||
BufSz int
|
BufSz int
|
||||||
LogFrame func(string, []byte, *layers.Ethernet)
|
LogFrame func(string, []byte, *layers.Ethernet)
|
||||||
Port int
|
Port int
|
||||||
}
|
}
|
||||||
|
|
||||||
type PacketSource interface {
|
type PacketSource interface {
|
||||||
@@ -422,9 +422,9 @@ func (router *Router) applyTopologyUpdate(update []byte) (PeerNameSet, PeerNameS
|
|||||||
// given an address like '1.2.3.4:567', return the address if it has a port,
|
// given an address like '1.2.3.4:567', return the address if it has a port,
|
||||||
// otherwise return the address with the default port number for the router
|
// otherwise return the address with the default port number for the router
|
||||||
func (router *Router) NormalisePeerAddr(peerAddr string) string {
|
func (router *Router) NormalisePeerAddr(peerAddr string) string {
|
||||||
_, _, err := net.SplitHostPort(peerAddr)
|
_, _, err := net.SplitHostPort(peerAddr)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return peerAddr
|
return peerAddr
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s:%d", peerAddr, router.Port)
|
return fmt.Sprintf("%s:%d", peerAddr, router.Port)
|
||||||
}
|
}
|
||||||
+1
-1
@@ -203,7 +203,7 @@ func handleHTTP(router *weave.Router, httpAddr string) {
|
|||||||
|
|
||||||
protocol := "tcp"
|
protocol := "tcp"
|
||||||
if strings.HasPrefix(httpAddr, "/") {
|
if strings.HasPrefix(httpAddr, "/") {
|
||||||
os.Remove(httpAddr); // in case it's there from last time
|
os.Remove(httpAddr) // in case it's there from last time
|
||||||
protocol = "unix"
|
protocol = "unix"
|
||||||
}
|
}
|
||||||
l, err := net.Listen(protocol, httpAddr)
|
l, err := net.Listen(protocol, httpAddr)
|
||||||
|
|||||||
Reference in new issue
Block a user