mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	larger out queue size, make sure linkOut packets always get sent first
This commit is contained in:
		
							parent
							
								
									0021f3463f
								
							
						
					
					
						commit
						cceecf4b1a
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -242,7 +242,7 @@ func (iface *tcpInterface) handler(sock net.Conn, incoming bool) {
 | 
			
		|||
	in := func(bs []byte) {
 | 
			
		||||
		p.handlePacket(bs)
 | 
			
		||||
	}
 | 
			
		||||
	out := make(chan []byte, 1)
 | 
			
		||||
	out := make(chan []byte, 1024) // Should be effectively infinite, but gets fed into finite LIFO stack
 | 
			
		||||
	defer close(out)
 | 
			
		||||
	go func() {
 | 
			
		||||
		var shadow int64
 | 
			
		||||
| 
						 | 
				
			
			@ -296,6 +296,7 @@ func (iface *tcpInterface) handler(sock net.Conn, incoming bool) {
 | 
			
		|||
				select {
 | 
			
		||||
				case msg := <-p.linkOut:
 | 
			
		||||
					send <- msg
 | 
			
		||||
					continue
 | 
			
		||||
				default:
 | 
			
		||||
				}
 | 
			
		||||
				// Then block until we send or receive something
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue