gofmt
This commit is contained in:
1 parent
d69854d9c5
commit
1b229fcc30
2 files changed
+4
-5
No files matched your search
@@ -131,7 +131,7 @@ const (
|
|||||||
func (conn *LocalConnection) Shutdown(err error) {
|
func (conn *LocalConnection) Shutdown(err error) {
|
||||||
conn.queryChan <- &ConnectionInteraction{
|
conn.queryChan <- &ConnectionInteraction{
|
||||||
Interaction: Interaction{code: CShutdown},
|
Interaction: Interaction{code: CShutdown},
|
||||||
payload: err}
|
payload: err}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Async
|
// 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)
|
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)
|
binary.BigEndian.PutUint64(heartbeatFrameBytes[EthernetOverhead:], conn.UID)
|
||||||
conn.heartbeatFrame = &ForwardedFrame{
|
conn.heartbeatFrame = &ForwardedFrame{
|
||||||
srcPeer: conn.local,
|
srcPeer: conn.local,
|
||||||
@@ -550,12 +550,11 @@ func (conn *LocalConnection) extendReadDeadline() {
|
|||||||
conn.TCPConn.SetReadDeadline(time.Now().Add(ReadTimeout))
|
conn.TCPConn.SetReadDeadline(time.Now().Add(ReadTimeout))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (conn *LocalConnection) sendFastHeartbeats() error {
|
func (conn *LocalConnection) sendFastHeartbeats() error {
|
||||||
err := conn.ensureForwarders()
|
err := conn.ensureForwarders()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
conn.heartbeat = time.NewTicker(FastHeartbeat)
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -265,7 +265,7 @@ func (router *Router) handleUDPPacketFunc(dec *EthernetDecoder, po PacketSink) F
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
switch {
|
switch {
|
||||||
case frameLen == EthernetOverhead + 8:
|
case frameLen == EthernetOverhead+8:
|
||||||
relayConn.ReceivedHeartbeat(sender, binary.BigEndian.Uint64(frame[EthernetOverhead:]))
|
relayConn.ReceivedHeartbeat(sender, binary.BigEndian.Uint64(frame[EthernetOverhead:]))
|
||||||
case frameLen == FragTestSize && bytes.Equal(frame, FragTest):
|
case frameLen == FragTestSize && bytes.Equal(frame, FragTest):
|
||||||
relayConn.SendTCP(ProtocolFragmentationReceivedByte)
|
relayConn.SendTCP(ProtocolFragmentationReceivedByte)
|
||||||
|
|||||||
Reference in new issue
Block a user