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:
parent
d9f212dd39
commit
db034ce6bd
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user