diff -urNb old.nmap.rev/nmap.cc new.nmap.rev/nmap.cc --- old.nmap.rev/nmap.cc 2007-12-20 22:22:43.000000000 -0800 +++ new.nmap.rev/nmap.cc 2007-12-20 22:22:43.000000000 -0800 @@ -725,7 +725,7 @@ } } else if (optcmp(long_options[option_index].name, "host-timeout") == 0) { l = tval2msecs(optarg); - if (l <= 1500) fatal("--host-timeout is specified in milliseconds unless you qualify it by appending 's', 'm', 'h', or 'd'. The value must be greater than 1500 milliseconds"); + if (l <= 0) fatal("--host-timeout is specified in milliseconds unless you qualify it by appending 's', 'm', 'h', or 'd'. The value must be positive"); pre_host_timeout = l; if (l < 15000) { error("host-timeout is given in milliseconds, so you specified less than 15 seconds (%lims). This is allowed but not recommended.", l); diff -urNb old.nmap.rev/nse_nsock.cc new.nmap.rev/nse_nsock.cc --- old.nmap.rev/nse_nsock.cc 2007-12-20 22:22:43.000000000 -0800 +++ new.nmap.rev/nse_nsock.cc 2007-12-20 22:22:43.000000000 -0800 @@ -172,7 +172,8 @@ auxiliar_setclass(l, "nsock", -1); udata->nsiod = NULL; udata->ssl_session = NULL; - udata->timeout = DEFAULT_TIMEOUT; + // If o.host_timeout == 0, use the default value, otherwise use o.host_timeout in millseconds + udata->timeout = o.host_timeout || DEFAULT_TIMEOUT; udata->bufidx = LUA_NOREF; udata->bufused= 0; udata->ncap_socket = NULL;