Skip to content

Commit

Permalink
Keep track of RPC token per-thread
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanusz-r7 committed Dec 12, 2024
1 parent 2355ab5 commit 686a463
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 686a463

Please sign in to comment.