mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	temporary workaround to concurrency bug in sessions.getSharedKey
This commit is contained in:
		
							parent
							
								
									fbe44ea973
								
							
						
					
					
						commit
						cd29fde178
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -298,6 +298,8 @@ func (ss *sessions) getPing(sinfo *sessionInfo) sessionPing {
 | 
				
			||||||
// This comes up with dht req/res and session ping/pong traffic.
 | 
					// This comes up with dht req/res and session ping/pong traffic.
 | 
				
			||||||
func (ss *sessions) getSharedKey(myPriv *crypto.BoxPrivKey,
 | 
					func (ss *sessions) getSharedKey(myPriv *crypto.BoxPrivKey,
 | 
				
			||||||
	theirPub *crypto.BoxPubKey) *crypto.BoxSharedKey {
 | 
						theirPub *crypto.BoxPubKey) *crypto.BoxSharedKey {
 | 
				
			||||||
 | 
						return crypto.GetSharedKey(myPriv, theirPub)
 | 
				
			||||||
 | 
						// FIXME concurrency issues with the below, so for now we just burn the CPU every time
 | 
				
			||||||
	if skey, isIn := ss.permShared[*theirPub]; isIn {
 | 
						if skey, isIn := ss.permShared[*theirPub]; isIn {
 | 
				
			||||||
		return skey
 | 
							return skey
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue