Skip to content

Commit

Permalink
HTTP::Request#client_run: Use one Hydra per thread to avoid segfaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Zapotek committed Dec 14, 2021
1 parent 5b0d6fe commit 5dbc384
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/arachni/http/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,13 @@ def prepare_headers
def client_run
# Set #on_complete so that the #response will be set.
on_complete {}
to_typhoeus.run

treq = self.to_typhoeus

hydra = (Thread.current[:client_run_hydra] ||= Typhoeus::Hydra.new)
hydra.queue treq
hydra.run

self.response
end

Expand Down

0 comments on commit 5dbc384

Please sign in to comment.