metamodules/autothrottle.rb in arachni-0.2.2.1 vs metamodules/autothrottle.rb in arachni-0.2.2.2
- old
+ new
@@ -15,11 +15,11 @@
# Auto adjusts HTTP throughput for maximum network utilization.
#
# @author: Tasos "Zapotek" Laskos
# <tasos.laskos@gmail.com>
# <zapotek@segfault.gr>
-# @version: 0.1
+# @version: 0.1.1
#
class AutoThrottle < Base
HIGH_THRESHOLD = 0.9
MIDDLE_THRESHOLD = 0.34
@@ -38,10 +38,10 @@
end
def prepare
# run for each response as it arrives
- @http.on_complete {
+ @http.add_on_complete {
# adjust only after finished bursts
next if @http.curr_res_cnt == 0 || @http.curr_res_cnt % @http.max_concurrency != 0
print_debug( "Max concurrency: " + @http.max_concurrency.to_s )