Skip to content

Commit

Permalink
fix: fix PID conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
NSEcho committed Dec 7, 2023
1 parent e91e893 commit 989f76a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions object.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ func PrintData(value any, decode, printHex bool,
}
name := data["connName"].(string)

var pid float64
if _, ok := data["pid"].(float64); ok {
pid = data["pid"].(float64)
}

if len(whitelist) > 0 || len(blacklist) > 0 {
if len(whitelist) > 0 && !connInList(name, whitelist) {
return
Expand All @@ -42,11 +47,13 @@ func PrintData(value any, decode, printHex bool,
}
}
} else {
if len(whitelistp) > 0 && !pidInList(data["pid"].(float64), whitelistp) {
return
} else {
if pidInList(data["pid"].(float64), blacklistp) {
if pid > 0 {
if len(whitelistp) > 0 && !pidInList(pid, whitelistp) {
return
} else {
if pidInList(pid, blacklistp) {
return
}
}
}
}
Expand Down

0 comments on commit 989f76a

Please sign in to comment.