From a46298dcc2906d9771215cc27cbfb5988b8d1586 Mon Sep 17 00:00:00 2001 From: ron Date: Mon, 24 Aug 2009 03:26:01 +0000 Subject: [PATCH] Added a script-arg to http.lua: pipeline. Setting pipeline lets you artificially increase/lower pipelining. The primary reason I added it is because sorting through packet captures with a hundred requests pipelined is difficult, so now I can lower it for debugging. I suggest using '--script-args=pipeline=1,limit=5' if troubleshooting issues with http-enum.nse. --- nselib/http.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nselib/http.lua b/nselib/http.lua index fe63c4dd3..5fdfa5028 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -16,6 +16,10 @@ -- @copyright Same as Nmap--See http://nmap.org/book/man-legal.html -- @args http-max-cache-size The maximum memory size (in bytes) of the cache. -- +--@arg pipeline If set, it represents the number of HTTP requests that'll be pipelined +-- (ie, sent in a single request). This can be set low to make debugging +-- easier, or it can be set high to test how a server reacts (its chosen +-- max is ignored). local MAX_CACHE_SIZE = "http-max-cache-size"; @@ -302,6 +306,11 @@ end -- @param response The http response - Might be a table or a raw response -- @return The max number of requests on a keep-alive connection local function getPipelineMax( response ) + -- Allow users to override this with a script-arg + if nmap.registry.args.pipeline ~= nil then + return tonumber(nmap.registry.args.pipeline) + end + if response then if type(response) ~= "table" then response = parseResult( response ) end if response.header and response.header.connection ~= "close" then