From 9c2558dbf05844e637838ec68a99c60a916d1d8b Mon Sep 17 00:00:00 2001 From: drbob Date: Fri, 13 Jun 2008 23:22:20 +0000 Subject: [PATCH] Final changes as we head towards V0.4.09a release. * Switched on RELEASE flag in libretroshare. * Added missing Mutex lock in upnphandler. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@598 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/rsserver/p3face-startup.cc | 21 ++++++++++---------- libretroshare/src/upnp/upnphandler.cc | 5 +++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/libretroshare/src/rsserver/p3face-startup.cc b/libretroshare/src/rsserver/p3face-startup.cc index ee6c24ed5..f9088f05a 100644 --- a/libretroshare/src/rsserver/p3face-startup.cc +++ b/libretroshare/src/rsserver/p3face-startup.cc @@ -78,6 +78,8 @@ #define RS_RELEASE 1 ****/ +#define RS_RELEASE 1 + /**************** PQI_USE_XPGP ******************/ #if defined(PQI_USE_XPGP) @@ -567,10 +569,6 @@ int RsServer::StartupRetroShare(RsInit *config) std::string localcachedir = config_dir + "/cache/local"; std::string remotecachedir = config_dir + "/cache/remote"; -#ifndef RS_RELEASE - p3GameLauncher *gameLauncher = new p3GameLauncher(mConnMgr); - pqih -> addService(gameLauncher); - mRanking = new p3Ranking(mConnMgr, RS_SERVICE_TYPE_RANK, /* declaration of cache enable service rank */ mCacheStrapper, mCacheTransfer, localcachedir, remotecachedir, 3600 * 24 * 30); @@ -578,6 +576,10 @@ int RsServer::StartupRetroShare(RsInit *config) CachePair cp(mRanking, mRanking, CacheId(RS_SERVICE_TYPE_RANK, 0)); mCacheStrapper -> addCachePair(cp); /* end of declaration */ +#ifndef RS_RELEASE + p3GameLauncher *gameLauncher = new p3GameLauncher(mConnMgr); + pqih -> addService(gameLauncher); + p3PhotoService *photoService = new p3PhotoService(RS_SERVICE_TYPE_PHOTO, /* .... for photo service */ mCacheStrapper, mCacheTransfer, localcachedir, remotecachedir); @@ -601,9 +603,8 @@ int RsServer::StartupRetroShare(RsInit *config) pqih -> addService(mForums); /* This must be also ticked as a service */ #else - mRanking = NULL; - mQBlog = NULL; - mForums = NULL; + mQblog = NULL; + //mForums = NULL; #endif /**************************************************************************/ @@ -626,8 +627,8 @@ int RsServer::StartupRetroShare(RsInit *config) mConfigMgr->addConfiguration("general.cfg", mGeneralConfig); mConfigMgr->addConfiguration("msgs.cfg", msgSrv); mConfigMgr->addConfiguration("cache.cfg", mCacheStrapper); -#ifndef RS_RELEASE mConfigMgr->addConfiguration("ranklink.cfg", mRanking); +#ifndef RS_RELEASE mConfigMgr->addConfiguration("qblog.cfg", mQblog); mConfigMgr->addConfiguration("forums.cfg", mForums); #endif @@ -753,10 +754,11 @@ int RsServer::StartupRetroShare(RsInit *config) rsPeers = new p3Peers(mConnMgr, mAuthMgr); rsMsgs = new p3Msgs(mAuthMgr, msgSrv, chatSrv); rsDisc = new p3Discovery(ad); + rsRanks = new p3Rank(mRanking); + #ifndef RS_RELEASE rsGameLauncher = gameLauncher; rsPhoto = new p3Photo(photoService); - rsRanks = new p3Rank(mRanking); rsForums = mForums; rsStatus = new p3Status(); rsQblog = new p3Blog(mQblog); @@ -764,7 +766,6 @@ int RsServer::StartupRetroShare(RsInit *config) #else rsGameLauncher = NULL; rsPhoto = NULL; - rsRanks = NULL; rsForums = NULL; rsStatus = NULL; rsQblog = NULL; diff --git a/libretroshare/src/upnp/upnphandler.cc b/libretroshare/src/upnp/upnphandler.cc index 800d38c5a..8bd6f186f 100644 --- a/libretroshare/src/upnp/upnphandler.cc +++ b/libretroshare/src/upnp/upnphandler.cc @@ -87,10 +87,15 @@ bool upnphandler::initUPnPState() fprintf(stderr, "No IGD UPnP Device found on the network !\n"); } + /* MODIFY STATE */ + dataMtx.lock(); /* LOCK MUTEX */ + upnpState = RS_UPNP_S_UNAVAILABLE; delete upcd; upnpConfig = NULL; + dataMtx.unlock(); /* UNLOCK MUTEX */ + /* done, FAILED -> NOT AVAILABLE */ return 0;