mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	correctly set peer.max
This commit is contained in:
		
							parent
							
								
									d43b93f60a
								
							
						
					
					
						commit
						cf2edc99d1
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		| 
						 | 
					@ -306,9 +306,7 @@ func (p *peer) _handleIdle() {
 | 
				
			||||||
		p.seq++
 | 
							p.seq++
 | 
				
			||||||
		p.bytesSent += uint64(size)
 | 
							p.bytesSent += uint64(size)
 | 
				
			||||||
		p.intf.out(packets)
 | 
							p.intf.out(packets)
 | 
				
			||||||
		if p.drop {
 | 
							p.max = p.queue.size
 | 
				
			||||||
			p.max = p.queue.size
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		p.idle = true
 | 
							p.idle = true
 | 
				
			||||||
		p.drop = false
 | 
							p.drop = false
 | 
				
			||||||
| 
						 | 
					@ -319,6 +317,7 @@ func (p *peer) dropFromQueue(from phony.Actor, seq uint64) {
 | 
				
			||||||
	p.Act(from, func() {
 | 
						p.Act(from, func() {
 | 
				
			||||||
		if seq == p.seq {
 | 
							if seq == p.seq {
 | 
				
			||||||
			p.drop = true
 | 
								p.drop = true
 | 
				
			||||||
 | 
								p.max = p.queue.size
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue