diff options
| author | Riccardo Spagni <ric@spagni.net> | 2015-05-20 14:36:04 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2015-05-20 14:36:07 +0200 |
| commit | 38068d07ca8ac5e00afb72b4dce2294742ef680f (patch) | |
| tree | 5fe223ef0927566948cefa06ac67b9c09839deb1 /src/p2p/connection_basic.cpp | |
| parent | 2939361d72e040e10c7b378facb32a56332ebd3b (diff) | |
| parent | f278fe3883f7d708082a19856eda02fddaf2fc56 (diff) | |
| download | monzero-core-38068d07ca8ac5e00afb72b4dce2294742ef680f.tar.gz monzero-core-38068d07ca8ac5e00afb72b4dce2294742ef680f.tar.xz monzero-core-38068d07ca8ac5e00afb72b4dce2294742ef680f.zip | |
Merge pull request #288
f278fe3 s/terget/target/ (moneromooo-monero)
d8ee0a9 print limits when running limit commands with no arguments (moneromooo-monero)
Diffstat (limited to 'src/p2p/connection_basic.cpp')
| -rw-r--r-- | src/p2p/connection_basic.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/p2p/connection_basic.cpp b/src/p2p/connection_basic.cpp index 0454f30e3..d3f6415c5 100644 --- a/src/p2p/connection_basic.cpp +++ b/src/p2p/connection_basic.cpp @@ -199,6 +199,23 @@ void connection_basic::set_rate_down_limit(uint64_t limit) { save_limit_to_file(limit); } +uint64_t connection_basic::get_rate_up_limit() { + uint64_t limit; + { + CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_out ); + limit = network_throttle_manager::get_global_throttle_out().get_target_speed(); + } + return limit; +} + +uint64_t connection_basic::get_rate_down_limit() { + uint64_t limit; + { + CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_in ); + limit = network_throttle_manager::get_global_throttle_in().get_target_speed(); + } + return limit; +} void connection_basic::save_limit_to_file(int limit) { // saving limit to file @@ -207,12 +224,12 @@ void connection_basic::save_limit_to_file(int limit) { { CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_out ); - epee::net_utils::data_logger::get_instance().add_data("upload_limit", network_throttle_manager::get_global_throttle_out().get_terget_speed() / 1024); + epee::net_utils::data_logger::get_instance().add_data("upload_limit", network_throttle_manager::get_global_throttle_out().get_target_speed() / 1024); } { CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_in ); - epee::net_utils::data_logger::get_instance().add_data("download_limit", network_throttle_manager::get_global_throttle_in().get_terget_speed() / 1024); + epee::net_utils::data_logger::get_instance().add_data("download_limit", network_throttle_manager::get_global_throttle_in().get_target_speed() / 1024); } } |
