From 7649ea0f9fe25f191018cc862a3c9341dac234ed Mon Sep 17 00:00:00 2001 From: Arceliar Date: Thu, 29 Aug 2019 21:59:28 -0500 Subject: [PATCH] remove sessionInfo.doFunc, have the api just use phony.Block instead --- src/yggdrasil/api.go | 13 +------------ src/yggdrasil/session.go | 5 ----- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/yggdrasil/api.go b/src/yggdrasil/api.go index 9e82ece1..d1753b69 100644 --- a/src/yggdrasil/api.go +++ b/src/yggdrasil/api.go @@ -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) } diff --git a/src/yggdrasil/session.go b/src/yggdrasil/session.go index 0b55aac8..d209a0de 100644 --- a/src/yggdrasil/session.go +++ b/src/yggdrasil/session.go @@ -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