diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-05-17 13:13:02 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-05-17 13:15:09 +0100 |
commit | d8ee0a95c7e3a1aba2aa79173f2d55f2db6f31cd (patch) | |
tree | 0c7eb5229f6a362066df52f1655249360352f922 /src/daemon/rpc_command_executor.cpp | |
parent | Merge pull request #286 (diff) | |
download | monero-d8ee0a95c7e3a1aba2aa79173f2d55f2db6f31cd.tar.xz |
print limits when running limit commands with no arguments
It's more user friendly that an error message saying the command
does not exist.
Diffstat (limited to 'src/daemon/rpc_command_executor.cpp')
-rw-r--r-- | src/daemon/rpc_command_executor.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 8ef91600c..79b52711a 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -737,6 +737,15 @@ bool t_rpc_command_executor::print_status() return true; } +bool t_rpc_command_executor::get_limit() +{ + int limit_down = epee::net_utils::connection_basic::get_rate_down_limit( ); + int limit_up = epee::net_utils::connection_basic::get_rate_up_limit( ); + std::cout << "limit-down is " << limit_down/1024 << " kB/s" << std::endl; + std::cout << "limit-up is " << limit_up/1024 << " kB/s" << std::endl; + return true; +} + bool t_rpc_command_executor::set_limit(int limit) { epee::net_utils::connection_basic::set_rate_down_limit( limit ); @@ -746,6 +755,13 @@ bool t_rpc_command_executor::set_limit(int limit) return true; } +bool t_rpc_command_executor::get_limit_up() +{ + int limit_up = epee::net_utils::connection_basic::get_rate_up_limit( ); + std::cout << "limit-up is " << limit_up/1024 << " kB/s" << std::endl; + return true; +} + bool t_rpc_command_executor::set_limit_up(int limit) { epee::net_utils::connection_basic::set_rate_up_limit( limit ); @@ -753,6 +769,13 @@ bool t_rpc_command_executor::set_limit_up(int limit) return true; } +bool t_rpc_command_executor::get_limit_down() +{ + int limit_down = epee::net_utils::connection_basic::get_rate_down_limit( ); + std::cout << "limit-down is " << limit_down/1024 << " kB/s" << std::endl; + return true; +} + bool t_rpc_command_executor::set_limit_down(int limit) { epee::net_utils::connection_basic::set_rate_down_limit( limit ); |