diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 1581df045..5a1881437 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -2243,6 +2243,7 @@ int RsServer::StartupRetroShare() mBitDht->setupPeerSharer(mBanList); p3BandwidthControl *mBwCtrl = new p3BandwidthControl(pqih); + pqih -> addService(mBwCtrl); #ifdef RS_DSDVTEST p3Dsdv *mDsdv = new p3Dsdv(mLinkMgr); diff --git a/libretroshare/src/services/p3bwctrl.cc b/libretroshare/src/services/p3bwctrl.cc index 30e6b373a..5d4ae6c44 100644 --- a/libretroshare/src/services/p3bwctrl.cc +++ b/libretroshare/src/services/p3bwctrl.cc @@ -165,6 +165,8 @@ bool p3BandwidthControl::checkAvailableBandwidth() rateMap.erase(it); } + printRateInfo_locked(std::cerr); + /* any left over rateMaps ... are bad! (or not active - more likely) */ return true; } @@ -264,12 +266,22 @@ int p3BandwidthControl::printRateInfo_locked(std::ostream &out) out << std::endl; //time_t now = time(NULL); + out << "Totals: "; + out << " In: " << mTotalRates.mRateIn; + out << " MaxIn: " << mTotalRates.mMaxRateIn; + out << " Out: " << mTotalRates.mRateOut; + out << " MaxOut: " << mTotalRates.mMaxRateOut; + out << std::endl; std::map::iterator bit; for(bit = mBwMap.begin(); bit != mBwMap.end(); bit++) { - //out << " Age: " << now - it->second.mTs; - //out << std::endl; + out << "\t" << bit->first; + out << " In: " << bit->second.mRates.mRateIn; + out << " MaxIn: " << bit->second.mRates.mMaxRateIn; + out << " Out: " << bit->second.mRates.mRateOut; + out << " MaxOut: " << bit->second.mRates.mMaxRateOut; + out << std::endl; } return true ; }