mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-21 23:40:26 -04:00
Fixed code issues resulting in excessive warnings
Cleaned up GXS code a bit, removed unused functions and types from nxs and serialise items git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7203 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
057939270f
commit
5440aec17b
12 changed files with 83 additions and 117 deletions
|
@ -153,9 +153,9 @@ const std::string RsGeneralDataService::MSG_META_STATUS = KEY_MSG_STATUS;
|
|||
const uint32_t RsGeneralDataService::GXS_MAX_ITEM_SIZE = 1572864; // 1.5 Mbytes
|
||||
|
||||
RsDataService::RsDataService(const std::string &serviceDir, const std::string &dbName, uint16_t serviceType,
|
||||
RsGxsSearchModule *mod, const std::string& key)
|
||||
: RsGeneralDataService(), mServiceDir(serviceDir), mDbName(mServiceDir + "/" + dbName), mServType(serviceType),
|
||||
mDbMutex("RsDataService"), mDb( new RetroDb(mDbName, RetroDb::OPEN_READWRITE_CREATE, key)) {
|
||||
RsGxsSearchModule * /* mod */, const std::string& key)
|
||||
: RsGeneralDataService(), mDbMutex("RsDataService"), mServiceDir(serviceDir), mDbName(mServiceDir + "/" + dbName), mServType(serviceType),
|
||||
mDb( new RetroDb(mDbName, RetroDb::OPEN_READWRITE_CREATE, key)) {
|
||||
|
||||
initialise();
|
||||
|
||||
|
@ -792,7 +792,7 @@ bool RsDataService::validSize(RsNxsGrp* grp) const
|
|||
return false;
|
||||
}
|
||||
|
||||
int RsDataService::retrieveNxsGrps(std::map<RsGxsGroupId, RsNxsGrp *> &grp, bool withMeta, bool cache){
|
||||
int RsDataService::retrieveNxsGrps(std::map<RsGxsGroupId, RsNxsGrp *> &grp, bool withMeta, bool /* cache */){
|
||||
|
||||
if(grp.empty()){
|
||||
|
||||
|
@ -888,7 +888,7 @@ void RsDataService::locked_retrieveGroups(RetroCursor* c, std::vector<RsNxsGrp*>
|
|||
}
|
||||
}
|
||||
|
||||
int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, bool cache, bool withMeta)
|
||||
int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, bool /* cache */, bool withMeta)
|
||||
{
|
||||
|
||||
GxsMsgReq::const_iterator mit = reqIds.begin();
|
||||
|
@ -1455,7 +1455,7 @@ uint32_t RsDataService::cacheSize() const {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int RsDataService::setCacheSize(uint32_t size)
|
||||
int RsDataService::setCacheSize(uint32_t /* size */)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -56,13 +56,31 @@
|
|||
RsGenExchange::RsGenExchange(RsGeneralDataService *gds, RsNetworkExchangeService *ns,
|
||||
RsSerialType *serviceSerialiser, uint16_t servType, RsGixs* gixs,
|
||||
uint32_t authenPolicy, uint32_t messageStorePeriod)
|
||||
: mGenMtx("GenExchange"), mDataStore(gds), mNetService(ns), mSerialiser(serviceSerialiser),
|
||||
mServType(servType), mGixs(gixs), mAuthenPolicy(authenPolicy), MESSAGE_STORE_PERIOD(messageStorePeriod),
|
||||
CREATE_FAIL(0), CREATE_SUCCESS(1), CREATE_FAIL_TRY_LATER(2), SIGN_MAX_ATTEMPTS(5),
|
||||
SIGN_FAIL(0), SIGN_SUCCESS(1), SIGN_FAIL_TRY_LATER(2),
|
||||
VALIDATE_FAIL(0), VALIDATE_SUCCESS(1), VALIDATE_FAIL_TRY_LATER(2), VALIDATE_MAX_ATTEMPTS(5),
|
||||
mCleaning(false), mLastClean(time(NULL)), mMsgCleanUp(NULL), mChecking(false), mIntegrityCheck(NULL),
|
||||
mLastCheck(time(NULL))
|
||||
: mGenMtx("GenExchange"),
|
||||
mDataStore(gds),
|
||||
mNetService(ns),
|
||||
mSerialiser(serviceSerialiser),
|
||||
mServType(servType),
|
||||
mGixs(gixs),
|
||||
mAuthenPolicy(authenPolicy),
|
||||
MESSAGE_STORE_PERIOD(messageStorePeriod),
|
||||
mCleaning(false),
|
||||
mLastClean(time(NULL)),
|
||||
mMsgCleanUp(NULL),
|
||||
mChecking(false),
|
||||
mLastCheck(time(NULL)),
|
||||
mIntegrityCheck(NULL),
|
||||
CREATE_FAIL(0),
|
||||
CREATE_SUCCESS(1),
|
||||
CREATE_FAIL_TRY_LATER(2),
|
||||
SIGN_MAX_ATTEMPTS(5),
|
||||
SIGN_FAIL(0),
|
||||
SIGN_SUCCESS(1),
|
||||
SIGN_FAIL_TRY_LATER(2),
|
||||
VALIDATE_FAIL(0),
|
||||
VALIDATE_SUCCESS(1),
|
||||
VALIDATE_FAIL_TRY_LATER(2),
|
||||
VALIDATE_MAX_ATTEMPTS(5)
|
||||
{
|
||||
|
||||
mDataAccess = new RsGxsDataAccess(gds);
|
||||
|
@ -284,7 +302,6 @@ void RsGenExchange::generatePublicFromPrivateKeys(const RsTlvSecurityKeySet &pri
|
|||
typedef std::map<std::string, RsTlvSecurityKey> keyMap;
|
||||
const keyMap& allKeys = privatekeySet.keys;
|
||||
keyMap::const_iterator cit = allKeys.begin();
|
||||
bool adminFound = false, publishFound = false;
|
||||
for(; cit != allKeys.end(); cit++)
|
||||
{
|
||||
const RsTlvSecurityKey& privKey = cit->second;
|
||||
|
@ -842,14 +859,12 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, RsTlvSecu
|
|||
|
||||
}
|
||||
|
||||
int RsGenExchange::validateGrp(RsNxsGrp* grp, RsTlvSecurityKeySet& grpKeySet)
|
||||
int RsGenExchange::validateGrp(RsNxsGrp* grp)
|
||||
{
|
||||
|
||||
bool needIdentitySign = false, idValidate = false;
|
||||
RsGxsGrpMetaData& metaData = *(grp->metaData);
|
||||
|
||||
int id_ret;
|
||||
|
||||
uint8_t author_flag = GXS_SERV::GRP_OPTION_AUTHEN_AUTHOR_SIGN;
|
||||
|
||||
PrivacyBitPos pos = GRP_OPTION_BITS;
|
||||
|
@ -2388,7 +2403,7 @@ void RsGenExchange::processRecvdGroups()
|
|||
if(deserialOk)
|
||||
{
|
||||
grp->metaData = meta;
|
||||
uint8_t ret = validateGrp(grp, meta->keys);
|
||||
uint8_t ret = validateGrp(grp);
|
||||
|
||||
|
||||
if(ret == VALIDATE_SUCCESS)
|
||||
|
|
|
@ -752,11 +752,10 @@ private:
|
|||
/*!
|
||||
* Attempts to validate group signatures
|
||||
* @param grp group to be validated
|
||||
* @param grpKeySet the keys set user has for the group
|
||||
* @return VALIDATE_SUCCESS for success, VALIDATE_FAIL for fail,
|
||||
* VALIDATE_ID_SIGN_NOT_AVAIL for Id sign key not avail (but requested)
|
||||
*/
|
||||
int validateGrp(RsNxsGrp* grp, RsTlvSecurityKeySet& grpKeySet);
|
||||
int validateGrp(RsNxsGrp* grp);
|
||||
|
||||
/*!
|
||||
* Checks flag against a given privacy bit block
|
||||
|
|
|
@ -44,10 +44,10 @@ RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds,
|
|||
RsNxsNetMgr *netMgr, RsNxsObserver *nxsObs,
|
||||
const RsServiceInfo serviceInfo,
|
||||
RsGixsReputation* reputations, RsGcxs* circles, bool grpAutoSync)
|
||||
: p3Config(servType), p3ThreadedService(),
|
||||
mTransactionTimeOut(TRANSAC_TIMEOUT), mServType(servType), mDataStore(gds), mTransactionN(0),
|
||||
mObserver(nxsObs), mNxsMutex("RsGxsNetService"), mNetMgr(netMgr), mSYNC_PERIOD(SYNC_PERIOD),
|
||||
mSyncTs(0), mReputations(reputations), mCircles(circles), mGrpAutoSync(grpAutoSync), mGrpServerUpdateItem(NULL),
|
||||
: p3ThreadedService(), p3Config(servType), mTransactionN(0),
|
||||
mObserver(nxsObs), mDataStore(gds), mServType(servType),
|
||||
mTransactionTimeOut(TRANSAC_TIMEOUT), mNetMgr(netMgr), mNxsMutex("RsGxsNetService"),
|
||||
mSyncTs(0), mSYNC_PERIOD(SYNC_PERIOD), mCircles(circles), mReputations(reputations), mGrpAutoSync(grpAutoSync), mGrpServerUpdateItem(NULL),
|
||||
mServiceInfo(serviceInfo)
|
||||
|
||||
{
|
||||
|
@ -2405,12 +2405,12 @@ bool RsGxsNetService::canSendMsgIds(const std::vector<RsGxsMsgMetaData*>& msgMet
|
|||
|
||||
/** inherited methods **/
|
||||
|
||||
void RsGxsNetService::pauseSynchronisation(bool enabled)
|
||||
void RsGxsNetService::pauseSynchronisation(bool /* enabled */)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RsGxsNetService::setSyncAge(uint32_t age)
|
||||
void RsGxsNetService::setSyncAge(uint32_t /* age */)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -92,21 +92,6 @@ public:
|
|||
*/
|
||||
void setSyncAge(uint32_t age);
|
||||
|
||||
/*!
|
||||
* Explicitly requests all the groups contained by a peer
|
||||
* Circumvents polling of peers for message
|
||||
* @param peerId id of peer
|
||||
*/
|
||||
void requestGroupsOfPeer(const RsPeerId& peerId){ return;}
|
||||
|
||||
/*!
|
||||
* get messages of a peer for a given group id, this circumvents the normal
|
||||
* polling of peers for messages of given group id
|
||||
* @param peerId Id of peer
|
||||
* @param grpId id of group to request messages for
|
||||
*/
|
||||
void requestMessagesOfPeer(const RsPeerId& peerId, const std::string& grpId){ return; }
|
||||
|
||||
/*!
|
||||
* pauses synchronisation of subscribed groups and request for group id
|
||||
* from peers
|
||||
|
@ -121,7 +106,7 @@ public:
|
|||
* @param msgId the messages to retrieve
|
||||
* @return request token to be redeemed
|
||||
*/
|
||||
int requestMsg(const RsGxsGrpMsgIdPair& msgId){ return 0;}
|
||||
int requestMsg(const RsGxsGrpMsgIdPair& /* msgId */){ return 0;}
|
||||
|
||||
/*!
|
||||
* Request for this group is sent through to peers on your network
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue