mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-06 01:07:03 +08:00
Fix: lost stack log info
This commit is contained in:
@@ -107,14 +107,16 @@ func (e *Engine) setDevice() (err error) {
|
||||
}
|
||||
|
||||
func (e *Engine) setStack() (err error) {
|
||||
handler := &fakeTunnel{}
|
||||
e.stack, err = stack.New(e.device, handler, stack.WithDefault())
|
||||
if err != nil {
|
||||
log.Infof(
|
||||
"[STACK] %s://%s <-> %s://%s",
|
||||
e.device.Type(), e.device.Name(),
|
||||
e.proxy.Proto(), e.proxy.Addr(),
|
||||
)
|
||||
}
|
||||
defer func() {
|
||||
if err == nil {
|
||||
log.Infof(
|
||||
"[STACK] %s://%s <-> %s://%s",
|
||||
e.device.Type(), e.device.Name(),
|
||||
e.proxy.Proto(), e.proxy.Addr(),
|
||||
)
|
||||
}
|
||||
}()
|
||||
|
||||
e.stack, err = stack.New(e.device, &fakeTunnel{}, stack.WithDefault())
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user