fixed retrotor compilation when removing dht and udp

This commit is contained in:
csoler 2017-12-31 17:27:21 +01:00
parent c00a236004
commit da5253059a
8 changed files with 47 additions and 15 deletions

View file

@ -65,6 +65,11 @@
#include <sys/param.h>
#endif
// This needs to be defined here, because when USE_BITDHT is unset, the variable, that is defined in libbitdht (not compiled!) will be missing.
#ifndef RS_USE_BITDHT
RsDht *rsDht = NULL ;
#endif
// for blocking signals
#include <signal.h>
@ -825,9 +830,10 @@ RsGRouter *rsGRouter = NULL ;
#include "pqi/p3linkmgr.h"
#include "pqi/p3netmgr.h"
#ifndef RETROTOR
#include "tcponudp/tou.h"
#include "tcponudp/rsudpstack.h"
#endif
#ifdef RS_USE_BITDHT
@ -1155,9 +1161,9 @@ int RsServer::StartupRetroShare()
#ifdef RS_USE_DHT_STUNNER
mNetMgr->setAddrAssist(new stunAddrAssist(mDhtStunner), new stunAddrAssist(mProxyStunner));
#endif // RS_USE_DHT_STUNNER
#else //RS_USE_BITDHT
/* install NULL Pointer for rsDht Interface */
rsDht = NULL;
// #else //RS_USE_BITDHT
// /* install NULL Pointer for rsDht Interface */
// rsDht = NULL;
#endif //RS_USE_BITDHT
@ -1474,7 +1480,11 @@ int RsServer::StartupRetroShare()
interfaces.mMsgs = rsMsgs;
interfaces.mTurtle = rsTurtle;
interfaces.mDisc = rsDisc;
#ifdef RS_USE_BITDHT
interfaces.mDht = rsDht;
#else
interfaces.mDht = NULL;
#endif
interfaces.mNotify = mNotify;
interfaces.mServiceControl = serviceCtrl;
interfaces.mPluginHandler = mPluginsManager;
@ -1511,7 +1521,9 @@ int RsServer::StartupRetroShare()
p3BanList *mBanList = new p3BanList(serviceCtrl, mNetMgr);
rsBanList = mBanList ;
pqih -> addService(mBanList, true);
#ifdef RS_USE_BITDHT
mBitDht->setupPeerSharer(mBanList);
#endif
p3BandwidthControl *mBwCtrl = new p3BandwidthControl(pqih);
pqih -> addService(mBwCtrl, true);