better APIs for sending protocol messages

no longer tagging requiring the caller to construct them
This commit is contained in:
Matthias Radestock committed 2015-01-20 22:31:16 +00:00
1 parent 644697977b
commit 1181a0cb33
5 files changed
+40 -40

No files matched your search

+2 -2
View File
@@ -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
}