aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/network_throttle-detail.cpp
diff options
context:
space:
mode:
authorrfree2monero <rfreemonero@op.pl>2015-02-20 22:28:03 +0100
committerrfree2monero <rfreemonero@op.pl>2015-02-20 22:28:03 +0100
commitae2a50659f7dc74a5446a0dc3a5f8f78563b9e1f (patch)
tree0d1e7332174fdad966a3048b6b12daee4d07f367 /src/p2p/network_throttle-detail.cpp
parentfixed size_t on windows (diff)
downloadmonero-ae2a50659f7dc74a5446a0dc3a5f8f78563b9e1f.tar.xz
2014 network limit 1.2 +utils +toc -doc -drmonero
new update of the pr with network limits more debug options: discarding downloaded blocks all or after given height. trying to trigger the locking errors. debug levels polished/tuned to sane values. debug/logging improved. warning: this pr should be correct code, but it could make an existing (in master version) locking error appear more often. it's a race on the list (map) of peers, e.g. between closing/deleting them versus working on them in net-limit sleep in sending chunk. the bug is not in this code/this pr, but in the master version. the locking problem of master will be fixed in other pr. problem is ub, and in practice is seems to usually cause program abort (tested on debian stable with updated gcc). see --help for option to add sleep to trigger the error faster.
Diffstat (limited to 'src/p2p/network_throttle-detail.cpp')
-rw-r--r--src/p2p/network_throttle-detail.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/p2p/network_throttle-detail.cpp b/src/p2p/network_throttle-detail.cpp
index 6b2ee698e..7426e6dc7 100644
--- a/src/p2p/network_throttle-detail.cpp
+++ b/src/p2p/network_throttle-detail.cpp
@@ -220,7 +220,7 @@ void network_throttle::_handle_trafic_exact(size_t packet_size, size_t orginal_s
std::ostringstream oss; oss << "["; for (auto sample: m_history) oss << sample.m_size << " "; oss << "]" << std::ends;
std::string history_str = oss.str();
- _info_c( "net/" + m_nameshort , "Throttle " << m_name << ": packet of ~"<<packet_size<<"b " << " (from "<<orginal_size<<" b)"
+ _dbg2_c( "net/" + m_nameshort , "Throttle " << m_name << ": packet of ~"<<packet_size<<"b " << " (from "<<orginal_size<<" b)"
<< " Speed AVG=" << std::setw(4) << ((long int)(cts .average/1024)) <<"[w="<<cts .window<<"]"
<< " " << std::setw(4) << ((long int)(cts2.average/1024)) <<"[w="<<cts2.window<<"]"
<<" / " << " Limit="<< ((long int)(m_target_speed/1024)) <<" KiB/sec "
@@ -312,7 +312,7 @@ void network_throttle::calculate_times(size_t packet_size, calculate_times_struc
if (dbg) {
std::ostringstream oss; oss << "["; for (auto sample: m_history) oss << sample.m_size << " "; oss << "]" << std::ends;
std::string history_str = oss.str();
- _info_c( "net/"+m_nameshort+"_c" ,
+ _dbg1_c( "net/"+m_nameshort+"_c" ,
(cts.delay > 0 ? "SLEEP" : "")
<< "dbg " << m_name << ": "
<< "speed is A=" << std::setw(8) <<cts.average<<" vs "