mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 16:57:08 +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 {
|
||||
f.Cleanup()
|
||||
}
|
||||
f.DumpNFTables()
|
||||
f.DumpIPTables()
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@ -45,6 +45,8 @@ func (s *Server) Setup() (err error) {
|
||||
logrus.Errorf("s.Firewall.Setup: %v", err)
|
||||
return err
|
||||
}
|
||||
s.Firewall.DumpNFTables()
|
||||
s.Firewall.DumpIPTables()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -71,8 +71,8 @@ func ProxyHalf(dst, src net.Conn, rw *rewrite.Rewriter, destAddr string) {
|
||||
})
|
||||
|
||||
if rw.Cache.Contains(destAddr) {
|
||||
// Fast path: known pass-through
|
||||
log.LogInfoWithAddr(srcAddr, destAddr, fmt.Sprintf("destination (%s) in cache, passing through", destAddr))
|
||||
// Fast path
|
||||
log.LogDebugWithAddr(srcAddr, destAddr, fmt.Sprintf("destination (%s) in cache, direct forward", destAddr))
|
||||
io.CopyBuffer(dst, src, one)
|
||||
return
|
||||
}
|
||||
|
||||
@ -64,7 +64,6 @@ func main() {
|
||||
}
|
||||
logrus.Info("UA3F exited gracefully")
|
||||
os.Exit(0)
|
||||
|
||||
}()
|
||||
|
||||
if err := srv.Start(); err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user