mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-12 20:31:17 +08:00
Compare commits
2 Commits
ce4cef0bfd
...
4437c8861c
Author | SHA1 | Date | |
---|---|---|---|
|
4437c8861c | ||
|
57725078e0 |
@ -229,20 +229,22 @@ func UpdateGeoDatabases() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getUpdateTime() (err error, time time.Time) {
|
func getUpdateTime() (err error, time time.Time) {
|
||||||
var fileInfo os.FileInfo
|
filesToCheck := []string{
|
||||||
if geodata.GeodataMode() {
|
C.Path.GeoIP(),
|
||||||
fileInfo, err = os.Stat(C.Path.GeoIP())
|
C.Path.MMDB(),
|
||||||
if err != nil {
|
C.Path.ASN(),
|
||||||
return err, time
|
C.Path.GeoSite(),
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
fileInfo, err = os.Stat(C.Path.MMDB())
|
for _, file := range filesToCheck {
|
||||||
if err != nil {
|
var fileInfo os.FileInfo
|
||||||
return err, time
|
fileInfo, err = os.Stat(file)
|
||||||
|
if err == nil {
|
||||||
|
return nil, fileInfo.ModTime()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fileInfo.ModTime()
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterGeoUpdater() {
|
func RegisterGeoUpdater() {
|
||||||
|
@ -625,7 +625,7 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
|
|||||||
// normal check for process
|
// normal check for process
|
||||||
uid, path, err := P.FindProcessName(metadata.NetWork.String(), metadata.SrcIP, int(metadata.SrcPort))
|
uid, path, err := P.FindProcessName(metadata.NetWork.String(), metadata.SrcIP, int(metadata.SrcPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debugln("[Process] find process %s error: %v", metadata.String(), err)
|
log.Debugln("[Process] find process error for %s: %v", metadata.String(), err)
|
||||||
} else {
|
} else {
|
||||||
metadata.Process = filepath.Base(path)
|
metadata.Process = filepath.Base(path)
|
||||||
metadata.ProcessPath = path
|
metadata.ProcessPath = path
|
||||||
@ -639,7 +639,7 @@ func match(metadata *C.Metadata) (C.Proxy, C.Rule, error) {
|
|||||||
// check package names
|
// check package names
|
||||||
pkg, err := P.FindPackageName(metadata)
|
pkg, err := P.FindPackageName(metadata)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debugln("[Process] find process %s error: %v", metadata.String(), err)
|
log.Debugln("[Process] find process error for %s: %v", metadata.String(), err)
|
||||||
} else {
|
} else {
|
||||||
metadata.Process = pkg
|
metadata.Process = pkg
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user