mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Removed p3ConnectMgr. Replaced it with p3LinkMgr, p3NetMgr and p3PeerMgr.
Updated references in other classes. * Most classes need p3LinkMgr, and only use two functions: OwnId() and getOnlineList() git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4416 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
21487bfdf6
commit
f6f721a492
55 changed files with 1226 additions and 1044 deletions
|
@ -52,7 +52,7 @@
|
|||
|
||||
#include "util/rsdir.h"
|
||||
|
||||
#include "pqi/p3connmgr.h"
|
||||
#include "pqi/p3linkmgr.h"
|
||||
#include "pqi/pqinotify.h"
|
||||
|
||||
#include "retroshare/rsiface.h"
|
||||
|
@ -1150,7 +1150,7 @@ bool ftController::FileRequest(const std::string& fname, const std::string& has
|
|||
std::cerr << std::endl;
|
||||
#endif
|
||||
(dit->second)->mTransfer->addFileSource(*it);
|
||||
setPeerState(dit->second->mTransfer, *it, rate, mConnMgr->isOnline(*it));
|
||||
setPeerState(dit->second->mTransfer, *it, rate, mLinkMgr->isOnline(*it));
|
||||
|
||||
IndicateConfigChanged(); /* new peer for transfer -> save */
|
||||
}
|
||||
|
@ -1245,7 +1245,7 @@ bool ftController::FileRequest(const std::string& fname, const std::string& has
|
|||
std::cerr << "ftController::FileRequest() adding peer: " << *it;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
setPeerState(tm, *it, rate, mConnMgr->isOnline(*it));
|
||||
setPeerState(tm, *it, rate, mLinkMgr->isOnline(*it));
|
||||
}
|
||||
|
||||
/* add structures into the accessible data. Needs to be locked */
|
||||
|
@ -1273,7 +1273,7 @@ bool ftController::FileRequest(const std::string& fname, const std::string& has
|
|||
|
||||
bool ftController::setPeerState(ftTransferModule *tm, std::string id, uint32_t maxrate, bool online)
|
||||
{
|
||||
if (id == mConnMgr->getOwnId())
|
||||
if (id == mLinkMgr->getOwnId())
|
||||
{
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftController::setPeerState() is Self";
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
|
||||
//#define DB_DEBUG 1
|
||||
|
||||
ftFiStore::ftFiStore(CacheStrapper *cs, CacheTransfer *cft, NotifyBase *cb_in,p3ConnectMgr *cnmgr,
|
||||
ftFiStore::ftFiStore(CacheStrapper *cs, CacheTransfer *cft, NotifyBase *cb_in,p3PeerMgr *pm,
|
||||
RsPeerId ownid, std::string cachedir)
|
||||
:FileIndexStore(cs, cft, cb_in,cnmgr, ownid, cachedir)
|
||||
:FileIndexStore(cs, cft, cb_in, pm, ownid, cachedir)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -366,8 +366,8 @@ void ftFiMonitor::setSharedDirectories(const std::list<SharedDirInfo>& dirList)
|
|||
|
||||
|
||||
|
||||
ftCacheStrapper::ftCacheStrapper(p3ConnectMgr *cm)
|
||||
:CacheStrapper(cm)
|
||||
ftCacheStrapper::ftCacheStrapper(p3LinkMgr *lm)
|
||||
:CacheStrapper(lm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,9 @@
|
|||
* So they work in the ft world.
|
||||
*/
|
||||
|
||||
class p3ConnectMgr ;
|
||||
class p3LinkMgr ;
|
||||
class p3PeerMgr ;
|
||||
|
||||
|
||||
#include "ft/ftsearch.h"
|
||||
#include "pqi/p3cfgmgr.h"
|
||||
|
@ -46,8 +48,7 @@ class p3ConnectMgr ;
|
|||
class ftFiStore: public FileIndexStore, public ftSearch
|
||||
{
|
||||
public:
|
||||
ftFiStore(CacheStrapper *cs, CacheTransfer *cft, NotifyBase *cb_in,
|
||||
p3ConnectMgr *,
|
||||
ftFiStore(CacheStrapper *cs, CacheTransfer *cft, NotifyBase *cb_in, p3PeerMgr *pm,
|
||||
RsPeerId ownid, std::string cachedir);
|
||||
|
||||
/* overloaded search function */
|
||||
|
@ -89,7 +90,7 @@ virtual bool loadList(std::list<RsItem *>& load);
|
|||
class ftCacheStrapper: public CacheStrapper, public ftSearch
|
||||
{
|
||||
public:
|
||||
ftCacheStrapper(p3ConnectMgr *cm);
|
||||
ftCacheStrapper(p3LinkMgr *cm);
|
||||
|
||||
/* overloaded search function */
|
||||
virtual bool search(const std::string &hash, uint32_t hintflags, FileInfo &info) const;
|
||||
|
|
|
@ -44,7 +44,7 @@ const int ftserverzone = 29539;
|
|||
#include "ft/ftdbase.h"
|
||||
|
||||
#include "pqi/pqi.h"
|
||||
#include "pqi/p3connmgr.h"
|
||||
#include "pqi/p3linkmgr.h"
|
||||
|
||||
#include "serialiser/rsserviceids.h"
|
||||
|
||||
|
@ -57,15 +57,15 @@ const int ftserverzone = 29539;
|
|||
***/
|
||||
|
||||
/* Setup */
|
||||
ftServer::ftServer(p3ConnectMgr *connMgr)
|
||||
ftServer::ftServer(p3PeerMgr *pm, p3LinkMgr *lm)
|
||||
: mP3iface(NULL),
|
||||
mConnMgr(connMgr),
|
||||
mLinkMgr(lm), mPeerMgr(pm),
|
||||
mCacheStrapper(NULL),
|
||||
mFiStore(NULL), mFiMon(NULL),
|
||||
mFtController(NULL), mFtExtra(NULL),
|
||||
mFtDataplex(NULL), mFtSearch(NULL), srvMutex("ftServer")
|
||||
{
|
||||
mCacheStrapper = new ftCacheStrapper(connMgr);
|
||||
mCacheStrapper = new ftCacheStrapper(lm);
|
||||
}
|
||||
|
||||
void ftServer::setConfigDirectory(std::string path)
|
||||
|
@ -101,8 +101,8 @@ void ftServer::addConfigComponents(p3ConfigMgr *mgr)
|
|||
std::string ftServer::OwnId()
|
||||
{
|
||||
std::string ownId;
|
||||
if (mConnMgr)
|
||||
ownId = mConnMgr->getOwnId();
|
||||
if (mLinkMgr)
|
||||
ownId = mLinkMgr->getOwnId();
|
||||
return ownId;
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ void ftServer::SetupFtServer(NotifyBase *cb)
|
|||
/* setup FiStore/Monitor */
|
||||
std::string localcachedir = mConfigPath + "/cache/local";
|
||||
std::string remotecachedir = mConfigPath + "/cache/remote";
|
||||
std::string ownId = mConnMgr->getOwnId();
|
||||
std::string ownId = mLinkMgr->getOwnId();
|
||||
|
||||
/* search/extras List */
|
||||
mFtExtra = new ftExtraList();
|
||||
|
@ -131,7 +131,7 @@ void ftServer::SetupFtServer(NotifyBase *cb)
|
|||
|
||||
|
||||
/* Make Cache Source/Store */
|
||||
mFiStore = new ftFiStore(mCacheStrapper, mFtController, cb,mConnMgr, ownId, remotecachedir);
|
||||
mFiStore = new ftFiStore(mCacheStrapper, mFtController, cb, mPeerMgr, ownId, remotecachedir);
|
||||
mFiMon = new ftFiMonitor(mCacheStrapper,cb, localcachedir, ownId,mConfigPath);
|
||||
|
||||
/* now add the set to the cachestrapper */
|
||||
|
@ -144,8 +144,8 @@ void ftServer::SetupFtServer(NotifyBase *cb)
|
|||
mFtSearch->addSearchMode(mFiMon, RS_FILE_HINTS_LOCAL);
|
||||
mFtSearch->addSearchMode(mFiStore, RS_FILE_HINTS_REMOTE);
|
||||
|
||||
mConnMgr->addMonitor(mFtController);
|
||||
mConnMgr->addMonitor(mCacheStrapper);
|
||||
mLinkMgr->addMonitor(mFtController);
|
||||
mLinkMgr->addMonitor(mCacheStrapper);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1052,9 +1052,6 @@ bool ftServer::handleCacheData()
|
|||
/* these go to the CacheStrapper! */
|
||||
CacheData data;
|
||||
data.pid = ci->PeerId();
|
||||
peerConnectState pca;
|
||||
mConnMgr->getFriendNetStatus(ci->PeerId(), pca);
|
||||
data.pname = pca.name;
|
||||
data.cid = CacheId(ci->cacheType, ci->cacheSubId);
|
||||
data.path = ci->file.path;
|
||||
data.name = ci->file.name;
|
||||
|
|
|
@ -69,6 +69,9 @@ class p3turtle;
|
|||
|
||||
class ftDwlQueue;
|
||||
|
||||
class p3PeerMgr;
|
||||
class p3LinkMgr;
|
||||
|
||||
class ftServer: public RsFiles, public ftDataSend, public RsThread
|
||||
{
|
||||
|
||||
|
@ -78,7 +81,7 @@ class ftServer: public RsFiles, public ftDataSend, public RsThread
|
|||
/******************** Setup ************************************/
|
||||
/***************************************************************/
|
||||
|
||||
ftServer(p3ConnectMgr *connMgr);
|
||||
ftServer(p3PeerMgr *peerMgr, p3LinkMgr *linkMgr);
|
||||
|
||||
/* Assign important variables */
|
||||
void setConfigDirectory(std::string path);
|
||||
|
@ -264,9 +267,11 @@ bool loadConfigMap(std::map<std::string, std::string> &configMap);
|
|||
* as each component is protected independently.
|
||||
*/
|
||||
|
||||
P3Interface *mP3iface; /* XXX THIS NEEDS PROTECTION */
|
||||
p3ConnectMgr *mConnMgr;
|
||||
P3Interface *mP3iface; /* XXX THIS NEEDS PROTECTION */
|
||||
|
||||
p3PeerMgr *mPeerMgr;
|
||||
p3LinkMgr *mLinkMgr;
|
||||
|
||||
ftCacheStrapper *mCacheStrapper;
|
||||
ftFiStore *mFiStore;
|
||||
ftFiMonitor *mFiMon;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue