mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-19 11:28:24 -04:00
Switched most of the services to use p3ServiceControl instead of p3LinkMgr.
- Added a couple of utility fns to p3ServiceControl too. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7211 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
efe9503c3a
commit
190988c3cc
33 changed files with 387 additions and 329 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "pqi/p3linkmgr.h"
|
||||
#include "pqi/p3netmgr.h"
|
||||
#include "pqi/pqipersongrp.h"
|
||||
|
||||
#include "util/rsnet.h"
|
||||
|
||||
|
@ -311,38 +312,35 @@ int p3BandwidthControl::printRateInfo_locked(std::ostream &out)
|
|||
}
|
||||
|
||||
/*************** pqiMonitor callback ***********************/
|
||||
void p3BandwidthControl::statusChange(const std::list<pqipeer> &plist)
|
||||
void p3BandwidthControl::statusChange(const std::list<pqiServicePeer> &plist)
|
||||
{
|
||||
std::list<pqipeer>::const_iterator it;
|
||||
std::list<pqiServicePeer>::const_iterator it;
|
||||
for (it = plist.begin(); it != plist.end(); it++)
|
||||
{
|
||||
if (it->state & RS_PEER_S_FRIEND)
|
||||
{
|
||||
RsStackMutex stack(mBwMtx); /****** LOCKED MUTEX *******/
|
||||
RsStackMutex stack(mBwMtx); /****** LOCKED MUTEX *******/
|
||||
|
||||
if (it->actions & RS_PEER_DISCONNECTED)
|
||||
if (it->actions & RS_SERVICE_PEER_DISCONNECTED)
|
||||
{
|
||||
/* remove from map */
|
||||
std::map<RsPeerId, BwCtrlData>::iterator bit;
|
||||
bit = mBwMap.find(it->id);
|
||||
if (bit == mBwMap.end())
|
||||
{
|
||||
/* remove from map */
|
||||
std::map<RsPeerId, BwCtrlData>::iterator bit;
|
||||
bit = mBwMap.find(it->id);
|
||||
if (bit == mBwMap.end())
|
||||
{
|
||||
std::cerr << "p3BandwidthControl::statusChange() ERROR";
|
||||
std::cerr << " Entry not in map";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
mBwMap.erase(bit);
|
||||
}
|
||||
std::cerr << "p3BandwidthControl::statusChange() ERROR";
|
||||
std::cerr << " Entry not in map";
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
else if (it->actions & RS_PEER_CONNECTED)
|
||||
else
|
||||
{
|
||||
/* stuff */
|
||||
BwCtrlData data;
|
||||
mBwMap[it->id] = data;
|
||||
mBwMap.erase(bit);
|
||||
}
|
||||
}
|
||||
else if (it->actions & RS_SERVICE_PEER_CONNECTED)
|
||||
{
|
||||
/* stuff */
|
||||
BwCtrlData data;
|
||||
mBwMap[it->id] = data;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue