Notify switch idle

This commit is contained in:
Neil Alexander 2019-01-05 00:32:28 +00:00
parent 00bf71a09a
commit 4363283a6f
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 6 additions and 0 deletions

View file

@ -45,6 +45,7 @@ func (l *awdl) create(boxPubKey *crypto.BoxPubKey, sigPubKey *crypto.SigPubKey,
intf.peer.out = func(msg []byte) {
defer func() { recover() }()
intf.send <- msg
l.core.switchTable.idleIn <- intf.peer.port
}
go intf.handler()
l.core.switchTable.idleIn <- intf.peer.port
@ -80,6 +81,7 @@ func (ai *awdlInterface) handler() {
select {
case p := <-ai.peer.linkOut:
ai.send <- p
ai.awdl.core.switchTable.idleIn <- ai.peer.port
continue
default:
}