Skip to content

Commit

Permalink
Merge pull request #19718 from sjanusz-r7/add-rpc-token
Browse files Browse the repository at this point in the history
Keep track of RPC token per-thread
  • Loading branch information
adfoster-r7 authored Dec 16, 2024
2 parents ebf7379 + 686a463 commit 0068857
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/msf/core/rpc/v10/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,16 @@ def process(req)
end
end

::Timeout.timeout(self.dispatcher_timeout) { self.handlers[group].send(mname, *msg) }
::Timeout.timeout(self.dispatcher_timeout) do
Thread.current[:rpc_token] = token
self.handlers[group].send(mname, *msg)
end

rescue ::Exception => e
elog('RPC Exception', error: e)
process_exception(e)
ensure
Thread.current[:rpc_token] = nil
end
end

Expand Down

0 comments on commit 0068857

Please sign in to comment.