Skip to content

Commit

Permalink
rpc_json: release global lock in error cases, fixup 9e37ac3
Browse files Browse the repository at this point in the history
  • Loading branch information
jesec committed Jul 9, 2021
1 parent a444970 commit f1985a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rpc/rpc_json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,12 @@ jsonrpc_call_command(const std::string& method, const json& params) {
const auto& result = rpc::commands.call_command(itr, object, target);

torrent::thread_base::release_global_lock();

return object_to_json(result);
} catch (torrent::input_error& e) {
torrent::thread_base::release_global_lock();
throw JsonRpcException(-32602, e.what());
} catch (torrent::local_error& e) {
torrent::thread_base::release_global_lock();
throw JsonRpcException(-32000, e.what());
}
}
Expand Down

0 comments on commit f1985a5

Please sign in to comment.