lib/metasploit/aggregator.rb in metasploit-aggregator-0.2.1 vs lib/metasploit/aggregator.rb in metasploit-aggregator-0.2.2
- old
+ new
@@ -103,11 +103,15 @@
# server_version = pb_to_array(@client.version(@no_params).value)[0]
# raise CompatibilityError("server version mis-match found #{server_version}") unless server_version == version
end
def available?
- @client.available(@no_params).answer
+ begin
+ @client.available(@no_params).answer
+ rescue GRPC::Unavailable
+ false # unavailable if client throws exception.
+ end
end
def sessions
pb_to_map(@client.sessions(@no_params).map)
end
@@ -346,10 +350,12 @@
uuid = nil
requestingThread = Thread.new do
loop do
sleep 0.1 # outer loop only occurs until uuid is set
- next if uuid.nil?
+ break unless uuid.nil?
+ end
+ while true
request = @local_server.request(uuid)
# TODO: with this in place we can just get the request queue and pop each item to process and forward
unless request.nil?
body = ""
body = request.body unless request.body.nil?