5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 15:20:30 +00:00

replace panics with warning messages if the tun reader/writer return an error

This commit is contained in:
Arceliar 2018-12-16 17:23:07 -06:00
parent d9f212dd39
commit db034ce6bd

View File

@ -56,8 +56,8 @@ func (tun *tunAdapter) start(ifname string, iftapmode bool, addr string, mtu int
tun.mutex.Lock() tun.mutex.Lock()
tun.isOpen = true tun.isOpen = true
tun.mutex.Unlock() tun.mutex.Unlock()
go func() { panic(tun.read()) }() go func() { tun.core.log.Println("WARNING: tun.read() exited with error:", tun.read()) }()
go func() { panic(tun.write()) }() go func() { tun.core.log.Println("WARNING: tun.write() exited with error:", tun.write()) }()
if iftapmode { if iftapmode {
go func() { go func() {
for { for {