mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
simplify a loop
This commit is contained in:
@@ -106,21 +106,13 @@ local function sendPacketsUDP(data, host, port, timeout, cnt, multiple)
|
||||
|
||||
local response
|
||||
|
||||
if ( multiple ) then
|
||||
while(true) do
|
||||
repeat
|
||||
status, response = socket:receive()
|
||||
if( not(status) ) then break end
|
||||
|
||||
local status, _, _, ip, _ = socket:get_info()
|
||||
table.insert(responses, { data = response, peer = ip } )
|
||||
end
|
||||
else
|
||||
status, response = socket:receive()
|
||||
if ( status ) then
|
||||
local status, _, _, ip, _ = socket:get_info()
|
||||
table.insert(responses, { data = response, peer = ip } )
|
||||
end
|
||||
end
|
||||
until not multiple
|
||||
|
||||
if (#responses>0) then
|
||||
socket:close()
|
||||
|
||||
Reference in New Issue
Block a user