5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 14:10:28 +00:00

slight change to peer function names/args

This commit is contained in:
Arceliar 2020-05-17 12:27:43 -05:00
parent 7720e169f2
commit d96ae156a1

View File

@ -264,22 +264,20 @@ func (p *peer) _handleTraffic(packet []byte) {
coords := peer_getPacketCoords(packet)
next := p.table.lookup(coords)
if nPeer, isIn := p.ports[next]; isIn {
nPeer.sendPacketsFrom(p, [][]byte{packet})
nPeer.sendPacketFrom(p, packet)
}
//p.core.switchTable.packetInFrom(p, packet)
}
func (p *peer) sendPacketsFrom(from phony.Actor, packets [][]byte) {
func (p *peer) sendPacketFrom(from phony.Actor, packet []byte) {
p.Act(from, func() {
p._sendPackets(packets)
p._sendPacket(packet)
})
}
func (p *peer) _sendPackets(packets [][]byte) {
func (p *peer) _sendPacket(packet []byte) {
size := p.queue.size
for _, packet := range packets {
p.queue.push(packet)
}
switch {
case p.idle:
p.idle = false