Auxiliary::Web::HTTP#run: don't allow connection or callback errors to abort the whole operation

unstable
Tasos Laskos 2013-01-09 18:38:09 +02:00
parent e1885cab0b
commit 74cdd918af
1 changed files with 6 additions and 1 deletions

View File

@ -123,7 +123,12 @@ class Auxiliary::Web::HTTP
# Spawn threads for each host # Spawn threads for each host
while tl.size <= (opts[:max_threads] || 5) && !@queue.empty? && (req = @queue.pop) while tl.size <= (opts[:max_threads] || 5) && !@queue.empty? && (req = @queue.pop)
tl << framework.threads.spawn( "#{self.class.name} - #{req})", false, req ) do |request| tl << framework.threads.spawn( "#{self.class.name} - #{req})", false, req ) do |request|
begin
request.handle_response request( request.url, request.opts ) request.handle_response request( request.url, request.opts )
rescue => e
print_error e.to_s
e.backtrace.each { |l| print_error "-- #{l}" }
end
end end
end end