From 08073b43b8aa165b1ef8fd18def6348133af7316 Mon Sep 17 00:00:00 2001 From: ron Date: Fri, 21 Aug 2009 23:42:07 +0000 Subject: [PATCH] Fix two bugs in the http libraries: 1) Re-add 443 to the common ssl ports (it was accidentally removed in an earlier patch) 2) If the header doesn't return the number of pipelined requests to perform, default to 40 instead of leaving it nil --- nselib/comm.lua | 2 +- nselib/http.lua | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nselib/comm.lua b/nselib/comm.lua index 6c856a8e9..cb7554bc2 100644 --- a/nselib/comm.lua +++ b/nselib/comm.lua @@ -146,7 +146,7 @@ end -- @param port_number The number of the port to check -- @return bool True if port is usually ssl, otherwise false local function is_ssl(port_number) - local common_ssl_ports = {465, 989, 990, 992, 993, 994, 995, 587, 6697, 6679, 8443} + local common_ssl_ports = {443, 465, 989, 990, 992, 993, 994, 995, 587, 6697, 6679, 8443} local table_size = table.maxn(common_ssl_ports) local i = 0 while i < table_size do diff --git a/nselib/http.lua b/nselib/http.lua index f41d24229..503655d18 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -280,6 +280,9 @@ local function getPipelineMax( response ) if response.header and response.header.connection ~= "close" then if response.header["keep-alive"] then local max = string.match( response.header["keep-alive"], "max\=(%d*)") + if(max == nil) then + return 40 + end return max else return 40 end end