mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-23 22:51:12 -04:00
added last minute check to avoid re-requesting IDs that have been loaded in cache after they where foundmissing
This commit is contained in:
parent
94918dc1a3
commit
b3ab99bd49
1 changed files with 15 additions and 4 deletions
|
@ -657,6 +657,8 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||||
// also time_stamp the key that this group represents
|
// also time_stamp the key that this group represents
|
||||||
timeStampKey(RsGxsId(gid),RsIdentityUsage(RsServiceType(serviceType()),RsIdentityUsage::IDENTITY_NEW_FROM_GXS_SYNC)) ;
|
timeStampKey(RsGxsId(gid),RsIdentityUsage(RsServiceType(serviceType()),RsIdentityUsage::IDENTITY_NEW_FROM_GXS_SYNC)) ;
|
||||||
should_subscribe = true;
|
should_subscribe = true;
|
||||||
|
|
||||||
|
std::cerr << "Received new identity " << gid << " and subscribing to it" << std::endl;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2954,9 +2956,19 @@ void p3IdService::requestIdsFromNet()
|
||||||
for(cit = mIdsNotPresent.begin(); cit != mIdsNotPresent.end();)
|
for(cit = mIdsNotPresent.begin(); cit != mIdsNotPresent.end();)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_IDS
|
#ifdef DEBUG_IDS
|
||||||
Dbg2() << __PRETTY_FUNCTION__ << " Processing missing key RsGxsId: "
|
Dbg2() << __PRETTY_FUNCTION__ << " Processing missing key RsGxsId: " << cit->first << std::endl;
|
||||||
<< cit->first << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
|
RsGxsIdCache data;
|
||||||
|
|
||||||
|
if(!mKeyCache.fetch(cit->first,data))
|
||||||
|
{
|
||||||
|
std::cerr << __PRETTY_FUNCTION__ << ". Dropping request for ID " << cit->first << " at last minute, because it was found in cache"<< std::endl;
|
||||||
|
auto tmp(cit);
|
||||||
|
++tmp;
|
||||||
|
mIdsNotPresent.erase(cit);
|
||||||
|
cit = tmp;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const RsGxsId& gxsId = cit->first;
|
const RsGxsId& gxsId = cit->first;
|
||||||
const std::list<RsPeerId>& peers = cit->second;
|
const std::list<RsPeerId>& peers = cit->second;
|
||||||
|
@ -3011,8 +3023,7 @@ void p3IdService::requestIdsFromNet()
|
||||||
{
|
{
|
||||||
const RsPeerId& peer = cit2->first;
|
const RsPeerId& peer = cit2->first;
|
||||||
std::list<RsGxsGroupId> grpIds;
|
std::list<RsGxsGroupId> grpIds;
|
||||||
for( std::list<RsGxsId>::const_iterator gxs_id_it = cit2->second.begin();
|
for( std::list<RsGxsId>::const_iterator gxs_id_it = cit2->second.begin(); gxs_id_it != cit2->second.end(); ++gxs_id_it )
|
||||||
gxs_id_it != cit2->second.end(); ++gxs_id_it )
|
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_IDS
|
#ifdef DEBUG_IDS
|
||||||
Dbg2() << __PRETTY_FUNCTION__ << " passing RsGxsId: " << *gxs_id_it
|
Dbg2() << __PRETTY_FUNCTION__ << " passing RsGxsId: " << *gxs_id_it
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue