mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	fix a data race when an existing session's coords are updated in response to a successful search
This commit is contained in:
		
							parent
							
								
									cee28d11f8
								
							
						
					
					
						commit
						6d3aefb825
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -192,7 +192,7 @@ func (sinfo *searchInfo) checkDHTRes(res *dhtRes) bool {
 | 
			
		|||
	finishSearch := func(sess *sessionInfo, err error) {
 | 
			
		||||
		if sess != nil {
 | 
			
		||||
			// FIXME (!) replay attacks could mess with coords? Give it a handle (tstamp)?
 | 
			
		||||
			sess.coords = res.Coords
 | 
			
		||||
			sess.Act(sinfo.searches.router, func() { sess.coords = res.Coords })
 | 
			
		||||
			sess.ping(sinfo.searches.router)
 | 
			
		||||
		}
 | 
			
		||||
		if err != nil {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue