mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	replace panics with warning messages if the tun reader/writer return an error
This commit is contained in:
		
							parent
							
								
									d9f212dd39
								
							
						
					
					
						commit
						db034ce6bd
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -56,8 +56,8 @@ func (tun *tunAdapter) start(ifname string, iftapmode bool, addr string, mtu int
 | 
			
		|||
	tun.mutex.Lock()
 | 
			
		||||
	tun.isOpen = true
 | 
			
		||||
	tun.mutex.Unlock()
 | 
			
		||||
	go func() { panic(tun.read()) }()
 | 
			
		||||
	go func() { panic(tun.write()) }()
 | 
			
		||||
	go func() { tun.core.log.Println("WARNING: tun.read() exited with error:", tun.read()) }()
 | 
			
		||||
	go func() { tun.core.log.Println("WARNING: tun.write() exited with error:", tun.write()) }()
 | 
			
		||||
	if iftapmode {
 | 
			
		||||
		go func() {
 | 
			
		||||
			for {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue