X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=include%2Ffreenet%2Fiindexrequester.h;h=7f0276303900eb61d298f7e08b23d21875f1a9ba;hb=b9c3763a932cebaa015a27fe111017f6f34dfbaa;hp=6ba9ae745bf608318f52edbd4e48911df1d70658;hpb=6b896a9e1dc143bba86795be1e9336549db9b85f;p=fms.git diff --git a/include/freenet/iindexrequester.h b/include/freenet/iindexrequester.h index 6ba9ae7..7f02763 100644 --- a/include/freenet/iindexrequester.h +++ b/include/freenet/iindexrequester.h @@ -127,20 +127,21 @@ void IIndexRequester::InitializeIIndexRequester() m_maxrequests=-1; m_fcpuniquename=""; - Option::instance()->Get("MessageBase",m_messagebase); + Option::Instance()->Get("MessageBase",m_messagebase); m_tempdate.SetToGMTime(); } template void IIndexRequester::Process() { - // max is the smaller of the config value or the total number of identities we will request from - long max=m_maxrequests>m_ids.size() ? m_ids.size() : m_maxrequests; + // max is the smaller of the config value or the total number of ids we will request from + typename std::map::size_type max=m_maxrequests>m_ids.size() ? m_ids.size() : m_maxrequests; // try to keep up to max requests going if(m_requesting.size()::iterator i=m_ids.begin(); + typename std::map::iterator i=m_ids.begin(); + while(i!=m_ids.end() && (*i).second==true) { i++; @@ -160,7 +161,7 @@ void IIndexRequester::Process() // this will recheck for ids every minute DateTime now; now.SetToGMTime(); - if(m_tempdate<(now-(1.0/1440.0))) + if(m_ids.size()==0 && m_tempdate<(now-(1.0/1440.0))) { PopulateIDList(); m_tempdate=now; @@ -179,7 +180,7 @@ void IIndexRequester::RegisterWithThread(FreenetMasterThread *thread) template void IIndexRequester::RemoveFromRequestList(const IDTYPE id) { - std::vector::iterator i=m_requesting.begin(); + typename std::vector::iterator i=m_requesting.begin(); while(i!=m_requesting.end() && (*i)!=id) { i++;