1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

Couple of patches from Sven Klemm that speed up http nse scripts by telling the server to automatically close the connection

This commit is contained in:
ejlbell
2008-01-14 00:13:30 +00:00
parent 09eac45476
commit e244e43f0d
2 changed files with 4 additions and 0 deletions

View File

@@ -71,6 +71,7 @@ action = function(host, port)
query = query .. "Accept: */*\r\n"
query = query .. "Accept-Language: en\r\n"
query = query .. "User-Agent: Nmap NSE\r\n"
query = query .. "Connection: close\r\n"
query = query .. "Host: " .. host.ip .. ":" .. port.number .. "\r\n\r\n"
local headers = get_http_headers(host.ip, port.number, query)
@@ -100,6 +101,7 @@ action = function(host, port)
query = query .. "Accept: */*\r\n"
query = query .. "Accept-Language: en\r\n"
query = query .. "User-Agent: Nmap NSE\r\n"
query = query .. "Connection: close\r\n"
query = query .. "Host: " .. host.ip .. ":" .. port.number .. "\r\n\r\n"
auth = ""
@@ -115,6 +117,7 @@ action = function(host, port)
query = query .. "Accept: */*\r\n"
query = query .. "Accept-Language: en\r\n"
query = query .. "User-Agent: Nmap NSE\r\n"
query = query .. "Connection: close\r\n"
query = query .. "Host: " .. host.ip .. ":" .. port.number .. "\r\n\r\n"
auth = ""

View File

@@ -48,6 +48,7 @@ action = function(host, port)
query = query .. "Accept-Language: en"
query = query .. "User-Agent: Nmap NSE"
query = query .. "Host: " .. host.ip .. ":" .. port.number
query = query .. "Connection: close"
query = query .. '\r\n\r\n';
try(soc:send(strbuf.dump(query, '\r\n')))