lib/http.rb in arachni-0.2.3 vs lib/http.rb in arachni-0.2.4

- old
+ new

@@ -64,10 +64,12 @@ attr_reader :cookie_jar attr_reader :request_count attr_reader :response_count + attr_reader :time_out_count + attr_reader :curr_res_time attr_reader :curr_res_cnt attr_reader :trainer @@ -125,15 +127,16 @@ @opts = { :user_agent => opts.user_agent, :follow_location => false, :disable_ssl_peer_verification => true, - # :timeout => 8000 + :timeout => 10000 }.merge( proxy_opts ) @request_count = 0 @response_count = 0 + @time_out_count = 0 # we'll use it to identify our requests @rand_seed = seed( ) @curr_res_time = 0 @@ -239,9 +242,14 @@ print_debug( 'Method: ' + res.request.method.to_s ) print_debug( 'Params: ' + res.request.params.to_s ) print_debug( 'Headers: ' + res.request.headers.to_s ) print_debug( 'Train?: ' + res.request.train?.to_s ) print_debug( '------------' ) + + if res.timed_out? + print_error( 'Request timed-out! -- ID# ' + res.request.id.to_s ) + @time_out_count += 1 + end if( req.train? ) # handle redirections if( ( redir = redirect?( res.dup ) ).is_a?( String ) ) req2 = get( redir, :remove_id => true )