mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Chore: distinguish udp request in log (#449)
This commit is contained in:
parent
d240994896
commit
77b38b3285
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
errIPNotFound = errors.New("cannot found ip")
|
||||
errIPNotFound = errors.New("couldn't find ip")
|
||||
errIPVersion = errors.New("ip version error")
|
||||
)
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ func (t *Tunnel) handleUDPConn(localConn C.ServerAdapter) {
|
|||
wg.Add(1)
|
||||
proxy, rule, err := t.resolveMetadata(metadata)
|
||||
if err != nil {
|
||||
log.Warnln("Parse metadata failed: %s", err.Error())
|
||||
log.Warnln("[UDP] Parse metadata failed: %s", err.Error())
|
||||
t.natTable.Delete(lockKey)
|
||||
wg.Done()
|
||||
return
|
||||
|
@ -190,7 +190,7 @@ func (t *Tunnel) handleUDPConn(localConn C.ServerAdapter) {
|
|||
|
||||
rawPc, nAddr, err := proxy.DialUDP(metadata)
|
||||
if err != nil {
|
||||
log.Warnln("dial %s error: %s", proxy.Name(), err.Error())
|
||||
log.Warnln("[UDP] dial %s error: %s", proxy.Name(), err.Error())
|
||||
t.natTable.Delete(lockKey)
|
||||
wg.Done()
|
||||
return
|
||||
|
@ -199,9 +199,9 @@ func (t *Tunnel) handleUDPConn(localConn C.ServerAdapter) {
|
|||
pc = newUDPTracker(rawPc, DefaultManager, metadata, rule)
|
||||
|
||||
if rule != nil {
|
||||
log.Infoln("%s --> %v match %s using %s", metadata.SrcIP.String(), metadata.String(), rule.RuleType().String(), rawPc.Chains().String())
|
||||
log.Infoln("[UDP] %s --> %v match %s using %s", metadata.SrcIP.String(), metadata.String(), rule.RuleType().String(), rawPc.Chains().String())
|
||||
} else {
|
||||
log.Infoln("%s --> %v doesn't match any rule using DIRECT", metadata.SrcIP.String(), metadata.String())
|
||||
log.Infoln("[UDP] %s --> %v doesn't match any rule using DIRECT", metadata.SrcIP.String(), metadata.String())
|
||||
}
|
||||
|
||||
t.natTable.Set(key, pc, addr)
|
||||
|
|
Loading…
Reference in New Issue
Block a user