summaryrefslogtreecommitdiff
path: root/xmake/modules/net/ping.lua
diff options
context:
space:
mode:
authorRedbeanw44602 <[email protected]>2024-12-04 22:27:39 +0800
committerRedbeanw44602 <[email protected]>2024-12-04 22:27:39 +0800
commit80507252590a9e98c8cc1a2ac04f1fcd987e5ed0 (patch)
tree6a102c12f2ed0dfac7dc407e8d99a4edfa202324 /xmake/modules/net/ping.lua
parentb4017ff0b4e2abb4737c0137d5079b7593c819b8 (diff)
fix speed test under non-english linux.
Diffstat (limited to 'xmake/modules/net/ping.lua')
-rw-r--r--xmake/modules/net/ping.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/modules/net/ping.lua b/xmake/modules/net/ping.lua
index 756ee76ff..689bf4d94 100644
--- a/xmake/modules/net/ping.lua
+++ b/xmake/modules/net/ping.lua
@@ -31,7 +31,7 @@ function _ping(ping, host)
elseif is_host("macosx") then
data = try { function () return os.iorun("%s -c 1 -t 1 %s", ping.program, host) end }
else
- -- https://github.com/xmake-io/xmake/issues/4470#issuecomment-1840338777
+ -- @see https://github.com/xmake-io/xmake/issues/4470#issuecomment-1840338777
data = try { function () return os.iorun("%s -c 1 -W 1 -n %s", ping.program, host) end }
if not data then
data = try { function () return os.iorun("%s -c 1 -W 1 %s", ping.program, host) end }
@@ -39,7 +39,7 @@ function _ping(ping, host)
end
local timeval = "65535"
if data then
- timeval = data:match("time[=<]([%d%s%.]-)ms", 1, true) or data:match("[=<]([%d%s%.]-)ms TTL", 1, true) or "65535"
+ timeval = data:match("= [^/]+/([^/]+)/", 1, true) or data:match("[=<]([%d%s%.]-)ms TTL", 1, true) or "65535"
end
if timeval then
timeval = tonumber(timeval:trim())