mirror of
https://github.com/safing/portmaster
synced 2025-09-02 10:39:22 +00:00
Merge pull request #1193 from safing/fix/things-for-0-14
Minor improvements and fixes for v1.0.14
This commit is contained in:
commit
40ef960ccc
8 changed files with 53 additions and 16 deletions
|
@ -50,7 +50,7 @@ function build {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# build
|
# build
|
||||||
./build main.go
|
./build
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo -e "\n${COL_BOLD}[core] $platform v$version: ${COL_RED}BUILD FAILED.${COL_OFF}"
|
echo -e "\n${COL_BOLD}[core] $platform v$version: ${COL_RED}BUILD FAILED.${COL_OFF}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -39,13 +39,13 @@ var (
|
||||||
systemIntegrationIssue = &systemIssue{
|
systemIntegrationIssue = &systemIssue{
|
||||||
id: "compat:system-integration-issue",
|
id: "compat:system-integration-issue",
|
||||||
title: "Detected System Integration Issue",
|
title: "Detected System Integration Issue",
|
||||||
message: "Portmaster detected a problem with its system integration. You can try to restart or reinstall the Portmaster. If that does not help, please report the issue via [GitHub](https://github.com/safing/portmaster/issues) or send a mail to [support@safing.io](mailto:support@safing.io) so we can help you out.",
|
message: "Portmaster detected a problem with its system integration. You can try to restart or reinstall the Portmaster. If that does not help, [get support here](https://safing.io/support/).",
|
||||||
level: notifications.Error,
|
level: notifications.Error,
|
||||||
}
|
}
|
||||||
systemCompatibilityIssue = &systemIssue{
|
systemCompatibilityIssue = &systemIssue{
|
||||||
id: "compat:compatibility-issue",
|
id: "compat:compatibility-issue",
|
||||||
title: "Detected Compatibility Issue",
|
title: "Detected Compatibility Issue",
|
||||||
message: "Portmaster detected that something is interfering with its operation. This could be a VPN, an Anti-Virus or another network protection software. Please check if you are running an incompatible [VPN client](https://docs.safing.io/portmaster/install/status/vpn-compatibility) or [software](https://docs.safing.io/portmaster/install/status/software-compatibility). Otherwise, please report the issue via [GitHub](https://github.com/safing/portmaster/issues) or send a mail to [support@safing.io](mailto:support@safing.io) so we can help you out.",
|
message: "Portmaster detected that something is interfering with its operation. This could be a VPN, an Anti-Virus or another network protection software. Please check if you are running an incompatible [VPN client](https://docs.safing.io/portmaster/install/status/vpn-compatibility) or [software](https://docs.safing.io/portmaster/install/status/software-compatibility) and disable it. If that does not help, [get support here](https://safing.io/support/).",
|
||||||
level: notifications.Error,
|
level: notifications.Error,
|
||||||
}
|
}
|
||||||
// manualDNSSetupRequired is additionally initialized in startNotify().
|
// manualDNSSetupRequired is additionally initialized in startNotify().
|
||||||
|
|
|
@ -28,11 +28,6 @@ var (
|
||||||
ErrPIDNotFound = errors.New("could not find pid for socket inode")
|
ErrPIDNotFound = errors.New("could not find pid for socket inode")
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
lookupTries = 20 // With a max wait of 5ms, this amounts to up to 100ms.
|
|
||||||
fastLookupTries = 2
|
|
||||||
)
|
|
||||||
|
|
||||||
// Lookup looks for the given connection in the system state tables and returns the PID of the associated process and whether the connection is inbound.
|
// Lookup looks for the given connection in the system state tables and returns the PID of the associated process and whether the connection is inbound.
|
||||||
func Lookup(pktInfo *packet.Info, fast bool) (pid int, inbound bool, err error) {
|
func Lookup(pktInfo *packet.Info, fast bool) (pid int, inbound bool, err error) {
|
||||||
// auto-detect version
|
// auto-detect version
|
||||||
|
|
|
@ -10,6 +10,11 @@ import (
|
||||||
"github.com/safing/portmaster/network/socket"
|
"github.com/safing/portmaster/network/socket"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
lookupTries = 20 // With a max wait of 5ms, this amounts to up to 100ms.
|
||||||
|
fastLookupTries = 2
|
||||||
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// This increases performance on unsupported system.
|
// This increases performance on unsupported system.
|
||||||
// It's not critical at all and does not break anything if it fails.
|
// It's not critical at all and does not break anything if it fails.
|
||||||
|
|
|
@ -12,9 +12,12 @@ var (
|
||||||
getTCP6Table = proc.GetTCP6Table
|
getTCP6Table = proc.GetTCP6Table
|
||||||
getUDP4Table = proc.GetUDP4Table
|
getUDP4Table = proc.GetUDP4Table
|
||||||
getUDP6Table = proc.GetUDP6Table
|
getUDP6Table = proc.GetUDP6Table
|
||||||
)
|
|
||||||
|
|
||||||
var baseWaitTime = 3 * time.Millisecond
|
lookupTries = 20 // With a max wait of 5ms, this amounts to up to 100ms.
|
||||||
|
fastLookupTries = 2
|
||||||
|
|
||||||
|
baseWaitTime = 3 * time.Millisecond
|
||||||
|
)
|
||||||
|
|
||||||
// CheckPID checks the if socket info already has a PID and if not, tries to find it.
|
// CheckPID checks the if socket info already has a PID and if not, tries to find it.
|
||||||
// Depending on the OS, this might be a no-op.
|
// Depending on the OS, this might be a no-op.
|
||||||
|
|
|
@ -10,6 +10,13 @@ var (
|
||||||
getTCP6Table = iphelper.GetTCP6Table
|
getTCP6Table = iphelper.GetTCP6Table
|
||||||
getUDP4Table = iphelper.GetUDP4Table
|
getUDP4Table = iphelper.GetUDP4Table
|
||||||
getUDP6Table = iphelper.GetUDP6Table
|
getUDP6Table = iphelper.GetUDP6Table
|
||||||
|
|
||||||
|
// With a max wait of 5ms, this amounts to up to 25ms,
|
||||||
|
// excluding potential data fetching time.
|
||||||
|
// Measured on Windows: ~150ms
|
||||||
|
lookupTries = 5
|
||||||
|
|
||||||
|
fastLookupTries = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
// CheckPID checks the if socket info already has a PID and if not, tries to find it.
|
// CheckPID checks the if socket info already has a PID and if not, tries to find it.
|
||||||
|
|
|
@ -31,13 +31,15 @@ func reportRequestDuration(started time.Time, resolver *Resolver) {
|
||||||
// getSlowQueriesSensorValue returns the current avg query time recorded by the
|
// getSlowQueriesSensorValue returns the current avg query time recorded by the
|
||||||
// slow queries sensor.
|
// slow queries sensor.
|
||||||
func getSlowQueriesSensorValue() (avgQueryTime time.Duration) {
|
func getSlowQueriesSensorValue() (avgQueryTime time.Duration) {
|
||||||
return time.Duration(
|
// Get values and check them.
|
||||||
slowQueriesSensorSum.Load() / slowQueriesSensorCnt.Load(),
|
sum := slowQueriesSensorSum.Load()
|
||||||
)
|
cnt := slowQueriesSensorCnt.Load()
|
||||||
|
if cnt < 1 {
|
||||||
|
cnt = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
// getAndResetSlowQueriesSensorValue returns the current avg query time
|
return time.Duration(sum / cnt)
|
||||||
// recorded by the slow queries sensor and reset the sensor values.
|
}
|
||||||
|
|
||||||
// resetSlowQueriesSensorValue reset the slow queries sensor values.
|
// resetSlowQueriesSensorValue reset the slow queries sensor values.
|
||||||
func resetSlowQueriesSensorValue() {
|
func resetSlowQueriesSensorValue() {
|
||||||
|
|
25
test
25
test
|
@ -131,6 +131,29 @@ if [[ $testonly -eq 0 ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# build portmaster-core for for all supported platforms
|
||||||
|
echo "building portmaster-core for all platforms"
|
||||||
|
cd ./cmds/portmaster-core
|
||||||
|
run env GOOS=linux GOARCH=amd64 ./build
|
||||||
|
run env GOOS=windows GOARCH=amd64 ./build
|
||||||
|
run env GOOS=darwin GOARCH=amd64 ./build
|
||||||
|
run env GOOS=linux GOARCH=arm64 ./build
|
||||||
|
run env GOOS=windows GOARCH=arm64 ./build
|
||||||
|
run env GOOS=darwin GOARCH=arm64 ./build
|
||||||
|
cd "$baseDir"
|
||||||
|
|
||||||
|
# build portmaster-start for for all supported platforms
|
||||||
|
echo ""
|
||||||
|
echo "building portmaster-start for all platforms"
|
||||||
|
cd ./cmds/portmaster-start
|
||||||
|
run env GOOS=linux GOARCH=amd64 ./build
|
||||||
|
# run env GOOS=windows GOARCH=amd64 ./build # TODO: Fix for GitHub CI
|
||||||
|
run env GOOS=darwin GOARCH=amd64 ./build
|
||||||
|
run env GOOS=linux GOARCH=arm64 ./build
|
||||||
|
# run env GOOS=windows GOARCH=arm64 ./build # TODO: Fix for GitHub CI
|
||||||
|
run env GOOS=darwin GOARCH=arm64 ./build
|
||||||
|
cd "$baseDir"
|
||||||
|
|
||||||
# target selection
|
# target selection
|
||||||
if [[ "$1" == "" ]]; then
|
if [[ "$1" == "" ]]; then
|
||||||
# get all packages
|
# get all packages
|
||||||
|
@ -138,10 +161,12 @@ if [[ "$1" == "" ]]; then
|
||||||
else
|
else
|
||||||
# single package testing
|
# single package testing
|
||||||
packages=$(go list -e)/$1
|
packages=$(go list -e)/$1
|
||||||
|
echo ""
|
||||||
echo "note: only running tests for package $packages"
|
echo "note: only running tests for package $packages"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# platform info
|
# platform info
|
||||||
|
echo ""
|
||||||
platformInfo=$(go env GOOS GOARCH)
|
platformInfo=$(go env GOOS GOARCH)
|
||||||
echo "running tests for ${platformInfo//$'\n'/ }:"
|
echo "running tests for ${platformInfo//$'\n'/ }:"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue