Use host.ip, not just (undefined) ip in whois.nse exception error

messages. Instead of handling an error nicely, it caused a format string
error of its own:
./nselib/stdnse.lua:61: bad argument #3 to 'format' (string expected, got nil)
It seems that a deadlock happens immediately after one of these errors
occurs. This change doesn't fix the deadlock but allows the underlying
error message to be printed.
This commit is contained in:
david 2009-04-29 23:33:44 +00:00
parent 318688acd5
commit 22a77a865c

View file

@ -191,7 +191,7 @@ action = function( host )
status, retval = pcall( get_next_action, tracking, host.ip )
if not status then
stdnse.print_debug( "%s %s pcall caught an exception in get_next_action: %s.", filename, ip, retval )
stdnse.print_debug( "%s %s pcall caught an exception in get_next_action: %s.", filename, host.ip, retval )
else tracking = retval end
if tracking.this_db then
@ -202,13 +202,13 @@ action = function( host )
-- analyse data
status, retval = pcall( analyse_response, tracking, host.ip, response, data )
if not status then
stdnse.print_debug( "%s %s pcall caught an exception in analyse_response: %s.", filename, ip, retval )
stdnse.print_debug( "%s %s pcall caught an exception in analyse_response: %s.", filename, host.ip, retval )
else data = retval end
-- get next action
status, retval = pcall( get_next_action, tracking, host.ip )
if not status then
stdnse.print_debug( "%s %s pcall caught an exception in get_next_action: %s.", filename, ip, retval )
stdnse.print_debug( "%s %s pcall caught an exception in get_next_action: %s.", filename, host.ip, retval )
if not tracking.last_db then tracking.last_db, tracking.this_db = tracking.this_db or tracking.next_db, nil end
else tracking = retval end
end