mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-09 07:02:41 -04:00
bugfixes: added debug printout and added as service.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5243 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7501d92882
commit
91b878fd61
2 changed files with 15 additions and 2 deletions
|
@ -2243,6 +2243,7 @@ int RsServer::StartupRetroShare()
|
||||||
mBitDht->setupPeerSharer(mBanList);
|
mBitDht->setupPeerSharer(mBanList);
|
||||||
|
|
||||||
p3BandwidthControl *mBwCtrl = new p3BandwidthControl(pqih);
|
p3BandwidthControl *mBwCtrl = new p3BandwidthControl(pqih);
|
||||||
|
pqih -> addService(mBwCtrl);
|
||||||
|
|
||||||
#ifdef RS_DSDVTEST
|
#ifdef RS_DSDVTEST
|
||||||
p3Dsdv *mDsdv = new p3Dsdv(mLinkMgr);
|
p3Dsdv *mDsdv = new p3Dsdv(mLinkMgr);
|
||||||
|
|
|
@ -165,6 +165,8 @@ bool p3BandwidthControl::checkAvailableBandwidth()
|
||||||
rateMap.erase(it);
|
rateMap.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printRateInfo_locked(std::cerr);
|
||||||
|
|
||||||
/* any left over rateMaps ... are bad! (or not active - more likely) */
|
/* any left over rateMaps ... are bad! (or not active - more likely) */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -264,12 +266,22 @@ int p3BandwidthControl::printRateInfo_locked(std::ostream &out)
|
||||||
out << std::endl;
|
out << std::endl;
|
||||||
|
|
||||||
//time_t now = time(NULL);
|
//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<std::string, BwCtrlData>::iterator bit;
|
std::map<std::string, BwCtrlData>::iterator bit;
|
||||||
for(bit = mBwMap.begin(); bit != mBwMap.end(); bit++)
|
for(bit = mBwMap.begin(); bit != mBwMap.end(); bit++)
|
||||||
{
|
{
|
||||||
//out << " Age: " << now - it->second.mTs;
|
out << "\t" << bit->first;
|
||||||
//out << std::endl;
|
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 ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue