(broken state) more WIP (cleanup)

This commit is contained in:
Arceliar 2021-05-08 11:35:04 -05:00
parent 0f787364de
commit b345806e3f
2 changed files with 6 additions and 227 deletions

View file

@ -41,8 +41,6 @@ type TunAdapter struct {
core *yggdrasil.Core
secret ed25519.PrivateKey
store keyStore
writer tunWriter
reader tunReader
config *config.NodeState
log *log.Logger
reconfigure chan chan error
@ -122,8 +120,6 @@ func (tun *TunAdapter) Init(secret ed25519.PrivateKey, core *yggdrasil.Core, con
tun.store.init(tun)
tun.config = config
tun.log = log
tun.writer.tun = tun
tun.reader.tun = tun
tun.core.SetOutOfBandHandler(tun.oobHandler)
return nil
@ -170,11 +166,9 @@ func (tun *TunAdapter) _start() error {
}
// TODO tun.core.SetMaximumSessionMTU(tun.MTU())
tun.isOpen = true
// TODO go tun.handler()
tun.reader.Act(nil, tun.reader._read) // Start the reader
tun.ckr.init(tun)
go tun.doRead()
go tun.doWrite()
go tun.read()
go tun.write()
return nil
}