mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	slight change to peer function names/args
This commit is contained in:
		
							parent
							
								
									7720e169f2
								
							
						
					
					
						commit
						d96ae156a1
					
				
					 1 changed files with 5 additions and 7 deletions
				
			
		| 
						 | 
					@ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue