mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	remove sessionInfo.doFunc, have the api just use phony.Block instead
This commit is contained in:
		
							parent
							
								
									1f658cce76
								
							
						
					
					
						commit
						7649ea0f9f
					
				
					 2 changed files with 1 additions and 17 deletions
				
			
		| 
						 | 
				
			
			@ -227,18 +227,7 @@ func (c *Core) GetSessions() []Session {
 | 
			
		|||
				}
 | 
			
		||||
				copy(session.PublicKey[:], sinfo.theirPermPub[:])
 | 
			
		||||
			}
 | 
			
		||||
			var skip bool
 | 
			
		||||
			func() {
 | 
			
		||||
				defer func() {
 | 
			
		||||
					if recover() != nil {
 | 
			
		||||
						skip = true
 | 
			
		||||
					}
 | 
			
		||||
				}()
 | 
			
		||||
				sinfo.doFunc(workerFunc)
 | 
			
		||||
			}()
 | 
			
		||||
			if skip {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
			phony.Block(sinfo, workerFunc)
 | 
			
		||||
			// TODO? skipped known but timed out sessions?
 | 
			
		||||
			sessions = append(sessions, session)
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -77,11 +77,6 @@ func (sinfo *sessionInfo) reconfigure() {
 | 
			
		|||
	// This is where reconfiguration would go, if we had anything to do
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO remove this, call SyncExec directly
 | 
			
		||||
func (sinfo *sessionInfo) doFunc(f func()) {
 | 
			
		||||
	phony.Block(sinfo, f)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Represents a session ping/pong packet, andincludes information like public keys, a session handle, coords, a timestamp to prevent replays, and the tun/tap MTU.
 | 
			
		||||
type sessionPing struct {
 | 
			
		||||
	SendPermPub crypto.BoxPubKey // Sender's permanent key
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue