better APIs for sending protocol messages
no longer tagging requiring the caller to construct them
This commit is contained in:
1 parent
644697977b
commit
1181a0cb33
5 files changed
+40
-40
No files matched your search
+2
-2
@@ -308,12 +308,12 @@ func (router *Router) handleUDPPacketFunc(dec *EthernetDecoder, po PacketSink) F
|
||||
case frameLen == EthernetOverhead+8:
|
||||
relayConn.ReceivedHeartbeat(sender, binary.BigEndian.Uint64(frame[EthernetOverhead:]))
|
||||
case frameLen == FragTestSize && bytes.Equal(frame, FragTest):
|
||||
relayConn.SendTCP(ProtocolFragmentationReceivedByte)
|
||||
relayConn.SendProtocolMsg(ProtocolFragmentationReceived, nil)
|
||||
case frameLen == PMTUDiscoverySize && bytes.Equal(frame, PMTUDiscovery):
|
||||
default:
|
||||
frameLenBytes := []byte{0, 0}
|
||||
binary.BigEndian.PutUint16(frameLenBytes, uint16(frameLen-EthernetOverhead))
|
||||
relayConn.SendTCP(Concat(ProtocolPMTUVerifiedByte, frameLenBytes))
|
||||
relayConn.SendProtocolMsg(ProtocolPMTUVerified, frameLenBytes)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user