mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-24 00:31:32 -04:00
Added Rate Cap to RateInterface, and enabled it for Relay Connections.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-dhtmods@4768 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
abbebf48ff
commit
dc8e596c0f
3 changed files with 62 additions and 1 deletions
|
@ -431,6 +431,9 @@ int pqiperson::connect(uint32_t type, struct sockaddr_in raddr,
|
|||
pqioutput(PQL_WARNING, pqipersonzone, "pqiperson::connect reset() before connection attempt");
|
||||
(it->second)->reset();
|
||||
|
||||
std::cerr << "pqiperson::connect() WARNING, clearing rate cap" << std::endl;
|
||||
setRateCap(0,0);
|
||||
|
||||
#ifdef PERSON_DEBUG
|
||||
std::cerr << "pqiperson::connect() setting connect_parameters" << std::endl;
|
||||
#endif
|
||||
|
@ -489,3 +492,17 @@ void pqiperson::setMaxRate(bool in, float val)
|
|||
}
|
||||
}
|
||||
|
||||
void pqiperson::setRateCap(float val_in, float val_out)
|
||||
{
|
||||
// set to all of them. (and us)
|
||||
PQInterface::setRateCap(val_in, val_out);
|
||||
// clean up the children.
|
||||
std::map<uint32_t, pqiconnect *>::iterator it;
|
||||
for(it = kids.begin(); it != kids.end(); it++)
|
||||
{
|
||||
(it->second) -> setRateCap(val_in, val_out);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue