mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-19 00:30:58 +00:00
chore: Try to restore process rules
This commit is contained in:
parent
a7040af346
commit
a883faae9d
1 changed files with 4 additions and 4 deletions
|
@ -595,8 +595,8 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
|
|||
configMux.RLock()
|
||||
defer configMux.RUnlock()
|
||||
var (
|
||||
resolved bool
|
||||
attemptProcessLookup = true
|
||||
resolved bool
|
||||
processFound bool
|
||||
)
|
||||
|
||||
if node, ok := resolver.DefaultHosts.Search(metadata.Host, false); ok {
|
||||
|
@ -620,8 +620,7 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
|
|||
}()
|
||||
}
|
||||
|
||||
if attemptProcessLookup && !findProcessMode.Off() && (findProcessMode.Always() || rule.ShouldFindProcess()) {
|
||||
attemptProcessLookup = false
|
||||
if !findProcessMode.Off() && !processFound && (findProcessMode.Always() || rule.ShouldFindProcess()) {
|
||||
uid, path, err := P.FindProcessName(metadata.NetWork.String(), metadata.SrcIP, int(metadata.SrcPort))
|
||||
if err != nil {
|
||||
log.Debugln("[Process] find process %s: %v", metadata.String(), err)
|
||||
|
@ -629,6 +628,7 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
|
|||
metadata.Process = filepath.Base(path)
|
||||
metadata.ProcessPath = path
|
||||
metadata.Uid = uid
|
||||
processFound = true
|
||||
if procesCache != metadata.Process {
|
||||
log.Debugln("[Process] %s from process %s", metadata.String(), path)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue