4
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2025-09-17 16:32:30 +00:00

more switch migration

This commit is contained in:
Arceliar
2019-08-24 15:22:46 -05:00
parent 555b4c18d4
commit 998c76fd8c
5 changed files with 42 additions and 38 deletions

View File

@@ -318,7 +318,9 @@ func (intf *linkInterface) handler() error {
isAlive = true
if !isReady {
// (Re-)enable in the switch
intf.link.core.switchTable.idleIn <- intf.peer.port
intf.link.core.switchTable.EnqueueFrom(nil, func() {
intf.link.core.switchTable._idleIn(intf.peer.port)
})
isReady = true
}
if gotMsg && !sendTimerRunning {
@@ -355,7 +357,9 @@ func (intf *linkInterface) handler() error {
isReady = false
} else {
// Keep enabled in the switch
intf.link.core.switchTable.idleIn <- intf.peer.port
intf.link.core.switchTable.EnqueueFrom(nil, func() {
intf.link.core.switchTable._idleIn(intf.peer.port)
})
isReady = true
}
case <-sendBlocked.C: