mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	explicitly consider the session finished case, and make a note that we could fix the packet drop situation by making the Conn into an actor too
This commit is contained in:
		
							parent
							
								
									e3603c0462
								
							
						
					
					
						commit
						cf9880464b
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -520,8 +520,12 @@ func (sinfo *sessionInfo) _recvPacket(p *wire_trafficPacket) {
 | 
			
		|||
			sinfo.bytesRecvd += uint64(len(bs))
 | 
			
		||||
			select {
 | 
			
		||||
			case sinfo.toConn <- bs:
 | 
			
		||||
			case <-sinfo.cancel.Finished():
 | 
			
		||||
				util.PutBytes(bs)
 | 
			
		||||
			default:
 | 
			
		||||
				// We seem to have filled up the buffer in the mean time, so drop it
 | 
			
		||||
				// We seem to have filled up the buffer in the mean time
 | 
			
		||||
				// Since we need to not block, but the conn isn't an actor, we need to drop this packet
 | 
			
		||||
				// TODO find some nicer way to interact with the Conn...
 | 
			
		||||
				util.PutBytes(bs)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue