mirror of
https://github.com/wownero/wownero.git
synced 2026-11-25 18:23:54 +01:00
rpc: hide ZMQ request contents in restricted mode
This commit is contained in:
@@ -99,8 +99,9 @@ namespace
|
||||
namespace rpc
|
||||
{
|
||||
|
||||
ZmqServer::ZmqServer(RpcHandler& h) :
|
||||
ZmqServer::ZmqServer(RpcHandler& h, const bool restricted) :
|
||||
handler(h),
|
||||
restricted(restricted),
|
||||
context(zmq_init(num_zmq_threads)),
|
||||
rep_socket(nullptr),
|
||||
pub_socket(nullptr),
|
||||
@@ -174,7 +175,10 @@ void ZmqServer::serve()
|
||||
}
|
||||
else // no errors
|
||||
{
|
||||
MDEBUG("Received RPC request: \"" << *message << "\"");
|
||||
if (restricted)
|
||||
MDEBUG("Received RPC request");
|
||||
else
|
||||
MDEBUG("Received RPC request: \"" << *message << "\"");
|
||||
epee::byte_slice response = handler.handle(std::move(*message));
|
||||
|
||||
const boost::string_ref response_view{reinterpret_cast<const char*>(response.data()), response.size()};
|
||||
|
||||
@@ -51,7 +51,7 @@ class ZmqServer final
|
||||
{
|
||||
public:
|
||||
|
||||
ZmqServer(RpcHandler& h);
|
||||
ZmqServer(RpcHandler& h, bool restricted);
|
||||
|
||||
~ZmqServer();
|
||||
|
||||
@@ -68,6 +68,7 @@ class ZmqServer final
|
||||
|
||||
private:
|
||||
RpcHandler& handler;
|
||||
const bool restricted;
|
||||
|
||||
net::zmq::context context;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user