diff options
| author | ruki <[email protected]> | 2021-04-11 22:05:30 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-04-11 22:05:30 +0800 |
| commit | e11d1143c5d403f9122da2c68c4a9f62796c0e0b (patch) | |
| tree | 1085574dc835b8f3f53e88e88cf0f827cc66196c | |
| parent | d2a9b2bf6d08ef5fcc70958f23df744581334c60 (diff) | |
improve ping
| -rw-r--r-- | xmake/modules/net/ping.lua | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/xmake/modules/net/ping.lua b/xmake/modules/net/ping.lua index 86472ce94..5f555cccd 100644 --- a/xmake/modules/net/ping.lua +++ b/xmake/modules/net/ping.lua @@ -21,7 +21,6 @@ -- imports import("core.cache.detectcache") import("detect.tools.find_ping") -import("detect.tools.find_nmap") import("private.async.runjobs") -- send ping to hosts @@ -78,21 +77,6 @@ function main(hosts, opt) if data then timeval = data:match("time=([%d%s%.]-)ms", 1, true) or data:match("=([%d%s%.]-)ms TTL", 1, true) or "65535" end - if timeval == "65535" then - local nmap = find_nmap() - if nmap then - data = try { function() return os.iorun("%s -T5 --max-retries 1 -p 80 --max-rtt-timeout 1 %s", nmap, host) end } - if data then - local timeval_s = data:match("in ([%d%.]-) seconds") - if timeval_s then - timeval_s = tonumber(timeval_s:trim()) * 1000 - if timeval_s > 0 then - timeval = tostring(timeval_s) - end - end - end - end - end -- save results if timeval then |
