fix actor EnqueueFrom stack overflow (use nil now to send from self) and replace session send/recv workers with actor functions

This commit is contained in:
Arceliar 2019-08-23 22:23:01 -05:00
parent 436c84ca33
commit 533da351f9
7 changed files with 132 additions and 17 deletions

View file

@ -245,7 +245,7 @@ func (t *switchTable) cleanRoot() {
if t.data.locator.root != t.key {
t.data.seq++
t.updater.Store(&sync.Once{})
t.core.router.reset(&t.core.router)
t.core.router.reset(nil)
}
t.data.locator = switchLocator{root: t.key, tstamp: now.Unix()}
t.core.peers.sendSwitchMsgs()
@ -508,7 +508,7 @@ func (t *switchTable) unlockedHandleMsg(msg *switchMsg, fromPort switchPort, rep
if !equiv(&sender.locator, &t.data.locator) {
doUpdate = true
t.data.seq++
t.core.router.reset(&t.core.router)
t.core.router.reset(nil)
}
if t.data.locator.tstamp != sender.locator.tstamp {
t.time = now