mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 14:10:54 -04:00
Fixed resource exhaustion due to message/group notification not being handled
Added message/group size limit Added message validation (identity and publish key) Added code for message/grp fragmentation/defragmentation (not integrated yet) Added crude id picker to photoshare git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6106 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
635f915f46
commit
7867063734
21 changed files with 735 additions and 264 deletions
|
@ -691,21 +691,24 @@ bool p3IdService::cache_store(const RsGxsIdGroupItem *item)
|
|||
|
||||
for (kit = keySet.keys.begin(); kit != keySet.keys.end(); kit++)
|
||||
{
|
||||
if (kit->second.keyFlags | RSTLV_KEY_DISTRIB_ADMIN)
|
||||
if (kit->second.keyFlags & RSTLV_KEY_DISTRIB_ADMIN)
|
||||
{
|
||||
std::cerr << "p3IdService::cache_store() Found Admin Key";
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* save full key - if we have it */
|
||||
if (kit->second.keyFlags | RSTLV_KEY_TYPE_FULL)
|
||||
if (kit->second.keyFlags & RSTLV_KEY_TYPE_FULL)
|
||||
{
|
||||
fullkey = kit->second;
|
||||
full_key_ok = true;
|
||||
}
|
||||
|
||||
/* cache public key always */
|
||||
pubkey = kit->second;
|
||||
pub_key_ok = true;
|
||||
if (kit->second.keyFlags & RSTLV_KEY_TYPE_PUBLIC_ONLY)
|
||||
{
|
||||
/* cache public key always */
|
||||
pubkey = kit->second;
|
||||
pub_key_ok = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,18 +68,18 @@ void p3Posted::service_tick()
|
|||
generatePosts();
|
||||
generateVotesAndComments();
|
||||
|
||||
time_t now = time(NULL);
|
||||
|
||||
if((now > (time_t) (VOTE_UPDATE_PERIOD + mLastUpdate)) &&
|
||||
(mUpdatePhase == UPDATE_PHASE_GRP_REQUEST))
|
||||
{
|
||||
mPostUpdate = true;
|
||||
mLastUpdate = time(NULL);
|
||||
}
|
||||
|
||||
updateVotes();
|
||||
|
||||
processRankings();
|
||||
// time_t now = time(NULL);
|
||||
//
|
||||
// if((now > (time_t) (VOTE_UPDATE_PERIOD + mLastUpdate)) &&
|
||||
// (mUpdatePhase == UPDATE_PHASE_GRP_REQUEST))
|
||||
// {
|
||||
// mPostUpdate = true;
|
||||
// mLastUpdate = time(NULL);
|
||||
// }
|
||||
//
|
||||
// updateVotes();
|
||||
//
|
||||
// processRankings();
|
||||
}
|
||||
|
||||
void p3Posted::generateVotesAndComments()
|
||||
|
@ -505,7 +505,6 @@ bool p3Posted::requestPostRankings(uint32_t &token, const RankType &rType, const
|
|||
gp->pubToken = token;
|
||||
gp->rankingResult.rType = gp->rType;
|
||||
gp->rankingResult.grpId = gp->grpId;
|
||||
gp->grpId = gp->grpId;
|
||||
|
||||
mPendingPostRanks.push_back(gp);
|
||||
|
||||
|
@ -768,6 +767,7 @@ bool p3Posted::completePostedPostCalc(GxsPostedPostRanking *gpp)
|
|||
break;
|
||||
default:
|
||||
std::cerr << "Unknown ranking tpye: " << gpp->rType << std::endl;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue