mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-26 06:01:37 +00:00
slight change to peer function names/args
This commit is contained in:
parent
7720e169f2
commit
d96ae156a1
@ -264,22 +264,20 @@ func (p *peer) _handleTraffic(packet []byte) {
|
|||||||
coords := peer_getPacketCoords(packet)
|
coords := peer_getPacketCoords(packet)
|
||||||
next := p.table.lookup(coords)
|
next := p.table.lookup(coords)
|
||||||
if nPeer, isIn := p.ports[next]; isIn {
|
if nPeer, isIn := p.ports[next]; isIn {
|
||||||
nPeer.sendPacketsFrom(p, [][]byte{packet})
|
nPeer.sendPacketFrom(p, packet)
|
||||||
}
|
}
|
||||||
//p.core.switchTable.packetInFrom(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.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
|
size := p.queue.size
|
||||||
for _, packet := range packets {
|
|
||||||
p.queue.push(packet)
|
p.queue.push(packet)
|
||||||
}
|
|
||||||
switch {
|
switch {
|
||||||
case p.idle:
|
case p.idle:
|
||||||
p.idle = false
|
p.idle = false
|
||||||
|
Loading…
Reference in New Issue
Block a user