mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-18 17:56:25 +00:00
refactor: remove redundant dump calls from Firewall setup and adjust logging level in ProxyHalf
This commit is contained in:
parent
186a88a654
commit
1c10f373b2
@ -118,8 +118,6 @@ func (f *Firewall) Setup(cfg *config.Config) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
f.Cleanup()
|
f.Cleanup()
|
||||||
}
|
}
|
||||||
f.DumpNFTables()
|
|
||||||
f.DumpIPTables()
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,8 @@ func (s *Server) Setup() (err error) {
|
|||||||
logrus.Errorf("s.Firewall.Setup: %v", err)
|
logrus.Errorf("s.Firewall.Setup: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
s.Firewall.DumpNFTables()
|
||||||
|
s.Firewall.DumpIPTables()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -71,8 +71,8 @@ func ProxyHalf(dst, src net.Conn, rw *rewrite.Rewriter, destAddr string) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if rw.Cache.Contains(destAddr) {
|
if rw.Cache.Contains(destAddr) {
|
||||||
// Fast path: known pass-through
|
// Fast path
|
||||||
log.LogInfoWithAddr(srcAddr, destAddr, fmt.Sprintf("destination (%s) in cache, passing through", destAddr))
|
log.LogDebugWithAddr(srcAddr, destAddr, fmt.Sprintf("destination (%s) in cache, direct forward", destAddr))
|
||||||
io.CopyBuffer(dst, src, one)
|
io.CopyBuffer(dst, src, one)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
logrus.Info("UA3F exited gracefully")
|
logrus.Info("UA3F exited gracefully")
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if err := srv.Start(); err != nil {
|
if err := srv.Start(); err != nil {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user