From 1b229fcc30c45fb4c5e06c6a85d0e8e914feed6a Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sat, 17 Jan 2015 19:20:48 +0000 Subject: [PATCH] gofmt --- router/connection.go | 7 +++---- router/router.go | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/router/connection.go b/router/connection.go index b78d2e74..9cfaac86 100644 --- a/router/connection.go +++ b/router/connection.go @@ -131,7 +131,7 @@ const ( func (conn *LocalConnection) Shutdown(err error) { conn.queryChan <- &ConnectionInteraction{ Interaction: Interaction{code: CShutdown}, - payload: err} + payload: err} } // Async @@ -176,7 +176,7 @@ func (conn *LocalConnection) run(queryChan <-chan *ConnectionInteraction, accept } log.Printf("->[%s] completed handshake with %s\n", conn.remoteTCPAddr, conn.remote.Name) - heartbeatFrameBytes := make([]byte, EthernetOverhead + 8) + heartbeatFrameBytes := make([]byte, EthernetOverhead+8) binary.BigEndian.PutUint64(heartbeatFrameBytes[EthernetOverhead:], conn.UID) conn.heartbeatFrame = &ForwardedFrame{ srcPeer: conn.local, @@ -550,12 +550,11 @@ func (conn *LocalConnection) extendReadDeadline() { conn.TCPConn.SetReadDeadline(time.Now().Add(ReadTimeout)) } - func (conn *LocalConnection) sendFastHeartbeats() error { err := conn.ensureForwarders() if err == nil { conn.heartbeat = time.NewTicker(FastHeartbeat) - conn.Forward(true, conn.heartbeatFrame, nil) // avoid initial wait + conn.Forward(true, conn.heartbeatFrame, nil) // avoid initial wait } return err } diff --git a/router/router.go b/router/router.go index aa0f05d7..fa0ca37e 100644 --- a/router/router.go +++ b/router/router.go @@ -265,7 +265,7 @@ func (router *Router) handleUDPPacketFunc(dec *EthernetDecoder, po PacketSink) F return nil } switch { - case frameLen == EthernetOverhead + 8: + case frameLen == EthernetOverhead+8: relayConn.ReceivedHeartbeat(sender, binary.BigEndian.Uint64(frame[EthernetOverhead:])) case frameLen == FragTestSize && bytes.Equal(frame, FragTest): relayConn.SendTCP(ProtocolFragmentationReceivedByte)