diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-05-17 19:09:11 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-05-17 19:09:11 +0200 |
commit | f03def87ad4a3be505955e01a0c54db29e30b4a7 (patch) | |
tree | a1999707625822ee4a0e5f28cc60fc09f0cdb808 /contrib/epee | |
parent | Merge pull request #837 (diff) | |
parent | Restrict also 'get_connections' and 'getbans' APIs. (diff) | |
download | monero-f03def87ad4a3be505955e01a0c54db29e30b4a7.tar.xz |
Merge pull request #840
1c0bffb Restrict also 'get_connections' and 'getbans' APIs. (osensei)
9f8bc49 Don't allow 'flush_txpool' and 'setbans' JSON_RPC methods when running in restricted mode. (osensei)
Diffstat (limited to 'contrib/epee')
-rw-r--r-- | contrib/epee/include/net/http_server_handlers_map2.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/epee/include/net/http_server_handlers_map2.h b/contrib/epee/include/net/http_server_handlers_map2.h index a822cce3e..3a7d5333b 100644 --- a/contrib/epee/include/net/http_server_handlers_map2.h +++ b/contrib/epee/include/net/http_server_handlers_map2.h @@ -168,8 +168,8 @@ response_info.m_header_info.m_content_type = " application/json"; \ LOG_PRINT( query_info.m_URI << "[" << method_name << "] processed with " << ticks1-ticks << "/"<< ticks2-ticks1 << "/" << ticks3-ticks2 << "ms", LOG_LEVEL_2); -#define MAP_JON_RPC_WE(method_name, callback_f, command_type) \ - else if(callback_name == method_name) \ +#define MAP_JON_RPC_WE_IF(method_name, callback_f, command_type, cond) \ + else if((callback_name == method_name) && (cond)) \ { \ PREPARE_OBJECTS_FROM_JSON(command_type) \ epee::json_rpc::error_response fail_resp = AUTO_VAL_INIT(fail_resp); \ @@ -184,6 +184,8 @@ return true;\ } +#define MAP_JON_RPC_WE(method_name, callback_f, command_type) MAP_JON_RPC_WE_IF(method_name, callback_f, command_type, true) + #define MAP_JON_RPC_WERI(method_name, callback_f, command_type) \ else if(callback_name == method_name) \ { \ |