diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 13d9b4634..68b4eba41 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1634,7 +1634,7 @@ uint32_t RsGenExchange::getSyncPeriod(const RsGxsGroupId& grpId) void RsGenExchange::setSyncPeriod(const RsGxsGroupId& grpId,uint32_t age_in_secs) { if(mNetService != NULL) - return mNetService->setKeepAge(grpId,age_in_secs) ; + return mNetService->setSyncAge(grpId,age_in_secs) ; else std::cerr << "(EE) No network service available. Cannot set storage period. " << std::endl; } diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 7758fe3ea..45f3ca1f9 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -1386,27 +1386,26 @@ bool RsGxsNetService::loadList(std::list &load) time_t now = time(NULL); -#warning Do we keep that? for(GrpConfigMap::iterator it(mServerGrpConfigMap.begin());it!=mServerGrpConfigMap.end();++it) - { - // At each reload, we reset the count of visible messages. It will be rapidely restored to its real value from friends. + { + // At each reload, we reset the count of visible messages. It will be rapidely restored to its real value from friends. - it->second.max_visible_count = 0; // std::max(it2->second.message_count,gnsr.max_visible_count) ; - - // the update time stamp is randomised so as not to ask all friends at once about group statistics. - - it->second.update_TS = now - GROUP_STATS_UPDATE_DELAY + (RSRandom::random_u32()%(GROUP_STATS_UPDATE_DELAY/10)) ; + it->second.max_visible_count = 0; // std::max(it2->second.message_count,gnsr.max_visible_count) ; - // Similarly, we remove all suppliers. - // Actual suppliers will come back automatically. + // the update time stamp is randomised so as not to ask all friends at once about group statistics. - it->second.suppliers.ids.clear() ; + it->second.update_TS = now - GROUP_STATS_UPDATE_DELAY + (RSRandom::random_u32()%(GROUP_STATS_UPDATE_DELAY/10)) ; - // also make sure that values stored for keep and req delays correspond to the canonical values + // Similarly, we remove all suppliers. + // Actual suppliers will come back automatically. - locked_checkDelay(it->second.msg_req_delay); - locked_checkDelay(it->second.msg_keep_delay); - } + it->second.suppliers.ids.clear() ; + + // also make sure that values stored for keep and req delays correspond to the canonical values + + locked_checkDelay(it->second.msg_req_delay); + locked_checkDelay(it->second.msg_keep_delay); + } return true; } @@ -1441,6 +1440,13 @@ bool RsGxsNetService::saveList(bool& cleanup, std::list& save) { RS_STACK_MUTEX(mNxsMutex) ; + // First, make sure that all IDs (which are needed twice) are consistent + + for(GrpConfigMap::iterator it(mServerGrpConfigMap.begin());it!=mServerGrpConfigMap.end();++it) it->second.grpId = it->first ; + for(ServerMsgMap::iterator it(mServerMsgUpdateMap.begin());it!=mServerMsgUpdateMap.end();++it) it->second.grpId = it->first ; + + std::cerr << "RsGxsNetService::saveList()..." << std::endl; + // hardcore templates std::transform(mClientGrpUpdateMap.begin(), mClientGrpUpdateMap.end(), std::back_inserter(save), get_second(mServType)); std::transform(mClientMsgUpdateMap.begin(), mClientMsgUpdateMap.end(), std::back_inserter(save), get_second(mServType));