mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 06:09:09 -04:00
changed post fixed operator++ into prefixed. More efficient on some systems. Patch from Phenom.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7630 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
880efee332
commit
d547cb6fdb
82 changed files with 717 additions and 718 deletions
|
@ -151,8 +151,8 @@ bool p3BanList::recvBanItem(RsBanListItem *item)
|
|||
bool updated = false;
|
||||
|
||||
std::list<RsTlvBanListEntry>::const_iterator it;
|
||||
//for(it = item->peerList.entries.begin(); it != item->peerList.entries.end(); it++)
|
||||
for(it = item->peerList.mList.begin(); it != item->peerList.mList.end(); it++)
|
||||
//for(it = item->peerList.entries.begin(); it != item->peerList.entries.end(); ++it)
|
||||
for(it = item->peerList.mList.begin(); it != item->peerList.mList.end(); ++it)
|
||||
{
|
||||
// Order is important!.
|
||||
updated = (addBanEntry(item->PeerId(), it->addr.addr, it->level,
|
||||
|
@ -274,7 +274,7 @@ int p3BanList::condenseBanSources_locked()
|
|||
#endif
|
||||
|
||||
std::map<RsPeerId, BanList>::const_iterator it;
|
||||
for(it = mBanSources.begin(); it != mBanSources.end(); it++)
|
||||
for(it = mBanSources.begin(); it != mBanSources.end(); ++it)
|
||||
{
|
||||
if (now - it->second.mLastUpdate > RSBANLIST_ENTRY_MAX_AGE)
|
||||
{
|
||||
|
@ -294,7 +294,7 @@ int p3BanList::condenseBanSources_locked()
|
|||
|
||||
std::map<struct sockaddr_storage, BanListPeer>::const_iterator lit;
|
||||
for(lit = it->second.mBanPeers.begin();
|
||||
lit != it->second.mBanPeers.end(); lit++)
|
||||
lit != it->second.mBanPeers.end(); ++lit)
|
||||
{
|
||||
/* check timestamp */
|
||||
if (now - lit->second.mTs > RSBANLIST_ENTRY_MAX_AGE)
|
||||
|
@ -415,7 +415,7 @@ void p3BanList::sendBanLists()
|
|||
|
||||
/* prepare packets */
|
||||
std::set<RsPeerId>::iterator it;
|
||||
for(it = idList.begin(); it != idList.end(); it++)
|
||||
for(it = idList.begin(); it != idList.end(); ++it)
|
||||
{
|
||||
#ifdef DEBUG_BANLIST
|
||||
std::cerr << "p3VoRS::sendBanList() To: " << *it;
|
||||
|
@ -438,7 +438,7 @@ int p3BanList::sendBanSet(const RsPeerId& peerid)
|
|||
{
|
||||
RsStackMutex stack(mBanMtx); /****** LOCKED MUTEX *******/
|
||||
std::map<struct sockaddr_storage, BanListPeer>::iterator it;
|
||||
for(it = mBanSet.begin(); it != mBanSet.end(); it++)
|
||||
for(it = mBanSet.begin(); it != mBanSet.end(); ++it)
|
||||
{
|
||||
if (it->second.level >= RSBANLIST_SOURCE_FRIEND)
|
||||
{
|
||||
|
@ -469,7 +469,7 @@ int p3BanList::printBanSet_locked(std::ostream &out)
|
|||
time_t now = time(NULL);
|
||||
|
||||
std::map<struct sockaddr_storage, BanListPeer>::iterator it;
|
||||
for(it = mBanSet.begin(); it != mBanSet.end(); it++)
|
||||
for(it = mBanSet.begin(); it != mBanSet.end(); ++it)
|
||||
{
|
||||
out << "Ban: " << sockaddr_storage_iptostring(it->second.addr);
|
||||
out << " Reason: " << it->second.reason;
|
||||
|
@ -492,7 +492,7 @@ int p3BanList::printBanSources_locked(std::ostream &out)
|
|||
time_t now = time(NULL);
|
||||
|
||||
std::map<RsPeerId, BanList>::const_iterator it;
|
||||
for(it = mBanSources.begin(); it != mBanSources.end(); it++)
|
||||
for(it = mBanSources.begin(); it != mBanSources.end(); ++it)
|
||||
{
|
||||
out << "BanList from: " << it->first;
|
||||
out << " LastUpdate: " << now - it->second.mLastUpdate;
|
||||
|
@ -500,7 +500,7 @@ int p3BanList::printBanSources_locked(std::ostream &out)
|
|||
|
||||
std::map<struct sockaddr_storage, BanListPeer>::const_iterator lit;
|
||||
for(lit = it->second.mBanPeers.begin();
|
||||
lit != it->second.mBanPeers.end(); lit++)
|
||||
lit != it->second.mBanPeers.end(); ++lit)
|
||||
{
|
||||
out << "\t";
|
||||
out << "Ban: " << sockaddr_storage_iptostring(lit->second.addr);
|
||||
|
|
|
@ -128,7 +128,7 @@ bool p3BandwidthControl::checkAvailableBandwidth()
|
|||
time_t now = time(NULL);
|
||||
std::list<RsPeerId> oldIds; // unused for now!
|
||||
|
||||
for(bit = mBwMap.begin(); bit != mBwMap.end(); bit++)
|
||||
for(bit = mBwMap.begin(); bit != mBwMap.end(); ++bit)
|
||||
{
|
||||
/* check alloc rate */
|
||||
//time_t age = now - bit->second.mLastSend;
|
||||
|
@ -255,7 +255,7 @@ int p3BandwidthControl::getAllBandwidthRates(std::map<RsPeerId, RsConfigDataRate
|
|||
RsStackMutex stack(mBwMtx); /****** LOCKED MUTEX *******/
|
||||
|
||||
std::map<RsPeerId, BwCtrlData>::iterator bit;
|
||||
for(bit = mBwMap.begin(); bit != mBwMap.end(); bit++)
|
||||
for(bit = mBwMap.begin(); bit != mBwMap.end(); ++bit)
|
||||
{
|
||||
RsConfigDataRates rates;
|
||||
|
||||
|
@ -299,7 +299,7 @@ int p3BandwidthControl::printRateInfo_locked(std::ostream &out)
|
|||
out << std::endl;
|
||||
|
||||
std::map<RsPeerId, BwCtrlData>::iterator bit;
|
||||
for(bit = mBwMap.begin(); bit != mBwMap.end(); bit++)
|
||||
for(bit = mBwMap.begin(); bit != mBwMap.end(); ++bit)
|
||||
{
|
||||
out << "\t" << bit->first;
|
||||
out << " In: " << bit->second.mRates.mRateIn;
|
||||
|
@ -315,7 +315,7 @@ int p3BandwidthControl::printRateInfo_locked(std::ostream &out)
|
|||
void p3BandwidthControl::statusChange(const std::list<pqiServicePeer> &plist)
|
||||
{
|
||||
std::list<pqiServicePeer>::const_iterator it;
|
||||
for (it = plist.begin(); it != plist.end(); it++)
|
||||
for (it = plist.begin(); it != plist.end(); ++it)
|
||||
{
|
||||
RsStackMutex stack(mBwMtx); /****** LOCKED MUTEX *******/
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ int p3ChatService::sendPublicChat(const std::string &msg)
|
|||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
for(it = ids.begin(); it != ids.end(); it++)
|
||||
for(it = ids.begin(); it != ids.end(); ++it)
|
||||
{
|
||||
RsChatMsgItem *ci = new RsChatMsgItem();
|
||||
|
||||
|
@ -967,7 +967,7 @@ void p3ChatService::handleRecvChatLobbyList(RsChatLobbyListItem *item)
|
|||
}
|
||||
|
||||
std::list<ChatLobbyId>::iterator it;
|
||||
for (it = chatLobbyToSubscribe.begin(); it != chatLobbyToSubscribe.end(); it++)
|
||||
for (it = chatLobbyToSubscribe.begin(); it != chatLobbyToSubscribe.end(); ++it)
|
||||
joinVisibleChatLobby(*it);
|
||||
|
||||
for(std::list<ChatLobbyId>::const_iterator it = invitationNeeded.begin();it!=invitationNeeded.end();++it)
|
||||
|
@ -1524,7 +1524,7 @@ bool p3ChatService::getPrivateChatQueueIds(bool incoming, std::list<RsPeerId> &i
|
|||
}
|
||||
|
||||
std::list<RsChatMsgItem *>::iterator it;
|
||||
for (it = list->begin(); it != list->end(); it++) {
|
||||
for (it = list->begin(); it != list->end(); ++it) {
|
||||
RsChatMsgItem *c = *it;
|
||||
|
||||
if (std::find(ids.begin(), ids.end(), c->PeerId()) == ids.end()) {
|
||||
|
@ -1553,7 +1553,7 @@ bool p3ChatService::getPrivateChatQueue(bool incoming, const RsPeerId &id, std::
|
|||
}
|
||||
|
||||
std::list<RsChatMsgItem *>::iterator it;
|
||||
for (it = list->begin(); it != list->end(); it++) {
|
||||
for (it = list->begin(); it != list->end(); ++it) {
|
||||
RsChatMsgItem *c = *it;
|
||||
|
||||
if (c->PeerId() == id) {
|
||||
|
@ -1603,7 +1603,7 @@ bool p3ChatService::clearPrivateChatQueue(bool incoming, const RsPeerId &id)
|
|||
continue;
|
||||
}
|
||||
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
} /* UNLOCKED */
|
||||
|
||||
|
@ -1656,7 +1656,7 @@ void p3ChatService::setOwnCustomStateString(const std::string& s)
|
|||
|
||||
// alert your online peers to your newly set status
|
||||
std::set<RsPeerId>::iterator it(onlineList.begin());
|
||||
for(; it != onlineList.end(); it++){
|
||||
for(; it != onlineList.end(); ++it){
|
||||
|
||||
RsChatStatusItem *cs = new RsChatStatusItem();
|
||||
cs->flags = RS_CHAT_FLAG_CUSTOM_STATE_AVAILABLE;
|
||||
|
@ -2095,7 +2095,7 @@ RsSerialiser *p3ChatService::setupSerialiser()
|
|||
void p3ChatService::statusChange(const std::list<pqiServicePeer> &plist)
|
||||
{
|
||||
std::list<pqiServicePeer>::const_iterator it;
|
||||
for (it = plist.begin(); it != plist.end(); it++) {
|
||||
for (it = plist.begin(); it != plist.end(); ++it) {
|
||||
if (it->actions & RS_SERVICE_PEER_CONNECTED)
|
||||
{
|
||||
/* send the saved outgoing messages */
|
||||
|
@ -2125,7 +2125,7 @@ void p3ChatService::statusChange(const std::list<pqiServicePeer> &plist)
|
|||
continue;
|
||||
}
|
||||
|
||||
cit++;
|
||||
++cit;
|
||||
}
|
||||
} /* UNLOCKED */
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ bool populateContactInfo(const peerState &detail, RsDiscContactItem *pkt)
|
|||
void DiscPgpInfo::mergeFriendList(const std::list<PGPID> &friends)
|
||||
{
|
||||
std::list<PGPID>::const_iterator it;
|
||||
for(it = friends.begin(); it != friends.end(); it++)
|
||||
for(it = friends.begin(); it != friends.end(); ++it)
|
||||
{
|
||||
mFriendSet.insert(*it);
|
||||
}
|
||||
|
@ -494,7 +494,7 @@ void p3discovery2::sendPGPList(const SSLID &toId)
|
|||
pkt->mode = DISC_PGP_LIST_MODE_FRIENDS;
|
||||
|
||||
std::map<PGPID, DiscPgpInfo>::const_iterator it;
|
||||
for(it = mFriendList.begin(); it != mFriendList.end(); it++)
|
||||
for(it = mFriendList.begin(); it != mFriendList.end(); ++it)
|
||||
{
|
||||
pkt->pgpIdSet.ids.push_back(it->first);
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ void p3discovery2::updatePgpFriendList()
|
|||
pgpList.push_back(ownPgpId);
|
||||
|
||||
// convert to set for ordering.
|
||||
for(lit = pgpList.begin(); lit != pgpList.end(); lit++)
|
||||
for(lit = pgpList.begin(); lit != pgpList.end(); ++lit)
|
||||
{
|
||||
pgpSet.insert(*lit);
|
||||
}
|
||||
|
@ -578,18 +578,18 @@ void p3discovery2::updatePgpFriendList()
|
|||
}
|
||||
|
||||
/* more to add? */
|
||||
for(; sit != pgpSet.end(); sit++)
|
||||
for(; sit != pgpSet.end(); ++sit)
|
||||
{
|
||||
pgpToAdd.push_back(*sit);
|
||||
}
|
||||
|
||||
for(; it != mFriendList.end(); it++)
|
||||
for(; it != mFriendList.end(); ++it)
|
||||
{
|
||||
/* more to remove */
|
||||
pgpToRemove.push_back(it->first);
|
||||
}
|
||||
|
||||
for(lit = pgpToRemove.begin(); lit != pgpToRemove.end(); lit++)
|
||||
for(lit = pgpToRemove.begin(); lit != pgpToRemove.end(); ++lit)
|
||||
{
|
||||
#ifdef P3DISC_DEBUG
|
||||
std::cerr << "p3discovery2::updatePgpFriendList() Removing pgpId: " << *lit;
|
||||
|
@ -600,7 +600,7 @@ void p3discovery2::updatePgpFriendList()
|
|||
mFriendList.erase(it);
|
||||
}
|
||||
|
||||
for(lit = pgpToAdd.begin(); lit != pgpToAdd.end(); lit++)
|
||||
for(lit = pgpToAdd.begin(); lit != pgpToAdd.end(); ++lit)
|
||||
{
|
||||
#ifdef P3DISC_DEBUG
|
||||
std::cerr << "p3discovery2::updatePgpFriendList() Adding pgpId: " << *lit;
|
||||
|
@ -663,7 +663,7 @@ void p3discovery2::processPGPList(const SSLID &fromId, const RsDiscPgpListItem *
|
|||
if (requestUnknownPgpCerts)
|
||||
{
|
||||
std::list<PGPID>::const_iterator fit;
|
||||
for(fit = item->pgpIdSet.ids.begin(); fit != item->pgpIdSet.ids.end(); fit++)
|
||||
for(fit = item->pgpIdSet.ids.begin(); fit != item->pgpIdSet.ids.end(); ++fit)
|
||||
{
|
||||
if (!AuthGPG::getAuthGPG()->isGPGId(*fit))
|
||||
{
|
||||
|
@ -717,7 +717,7 @@ void p3discovery2::updatePeers_locked(const SSLID &aboutId)
|
|||
|
||||
const std::set<PGPID> &friendSet = ait->second.mFriendSet;
|
||||
std::set<PGPID>::const_iterator fit;
|
||||
for(fit = friendSet.begin(); fit != friendSet.end(); fit++)
|
||||
for(fit = friendSet.begin(); fit != friendSet.end(); ++fit)
|
||||
{
|
||||
|
||||
#ifdef P3DISC_DEBUG
|
||||
|
@ -749,7 +749,7 @@ void p3discovery2::updatePeers_locked(const SSLID &aboutId)
|
|||
|
||||
std::map<SSLID, DiscSslInfo>::const_iterator mit;
|
||||
for(mit = ffit->second.mSslIds.begin();
|
||||
mit != ffit->second.mSslIds.end(); mit++)
|
||||
mit != ffit->second.mSslIds.end(); ++mit)
|
||||
{
|
||||
SSLID sslid = mit->first;
|
||||
if (mServiceCtrl->isPeerConnected(getServiceInfo().mServiceType, sslid))
|
||||
|
@ -770,7 +770,7 @@ void p3discovery2::updatePeers_locked(const SSLID &aboutId)
|
|||
std::cerr << std::endl;
|
||||
#endif
|
||||
// update aboutId about Other Peers.
|
||||
for(fit = mutualFriends.begin(); fit != mutualFriends.end(); fit++)
|
||||
for(fit = mutualFriends.begin(); fit != mutualFriends.end(); ++fit)
|
||||
{
|
||||
sendContactInfo_locked(*fit, aboutId);
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ void p3discovery2::updatePeers_locked(const SSLID &aboutId)
|
|||
std::cerr << std::endl;
|
||||
#endif
|
||||
// update Other Peers about aboutPgpId.
|
||||
for(sit = onlineFriends.begin(); sit != onlineFriends.end(); sit++)
|
||||
for(sit = onlineFriends.begin(); sit != onlineFriends.end(); ++sit)
|
||||
{
|
||||
// This could be more efficient, and only be specific about aboutId.
|
||||
// but we'll leave it like this for the moment.
|
||||
|
@ -816,7 +816,7 @@ void p3discovery2::sendContactInfo_locked(const PGPID &aboutId, const SSLID &toI
|
|||
}
|
||||
|
||||
std::map<SSLID, DiscSslInfo>::const_iterator sit;
|
||||
for(sit = it->second.mSslIds.begin(); sit != it->second.mSslIds.end(); sit++)
|
||||
for(sit = it->second.mSslIds.begin(); sit != it->second.mSslIds.end(); ++sit)
|
||||
{
|
||||
#ifdef P3DISC_DEBUG
|
||||
std::cerr << "p3discovery2::sendContactInfo_locked() related sslId: " << sit->first;
|
||||
|
@ -984,7 +984,7 @@ void p3discovery2::recvPGPCertificateRequest(const SSLID &fromId, const RsDiscPg
|
|||
#endif
|
||||
|
||||
std::list<RsPgpId>::const_iterator it;
|
||||
for(it = item->pgpIdSet.ids.begin(); it != item->pgpIdSet.ids.end(); it++)
|
||||
for(it = item->pgpIdSet.ids.begin(); it != item->pgpIdSet.ids.end(); ++it)
|
||||
{
|
||||
// NB: This doesn't include own certificates? why not.
|
||||
// shouldn't be a real problem. Peer must have own PgpCert already.
|
||||
|
@ -1071,7 +1071,7 @@ void p3discovery2::statusChange(const std::list<pqiServicePeer> &plist)
|
|||
//#endif
|
||||
|
||||
std::list<pqiServicePeer>::const_iterator pit;
|
||||
for(pit = plist.begin(); pit != plist.end(); pit++)
|
||||
for(pit = plist.begin(); pit != plist.end(); ++pit)
|
||||
{
|
||||
if (pit->actions & RS_SERVICE_PEER_CONNECTED)
|
||||
{
|
||||
|
@ -1131,7 +1131,7 @@ bool p3discovery2::getDiscFriends(const RsPeerId& id, std::list<RsPeerId> &proxy
|
|||
// For each of their friends that we know, grab that set of SSLIDs.
|
||||
const std::set<PGPID> &friendSet = it->second.mFriendSet;
|
||||
std::set<PGPID>::const_iterator fit;
|
||||
for(fit = friendSet.begin(); fit != friendSet.end(); fit++)
|
||||
for(fit = friendSet.begin(); fit != friendSet.end(); ++fit)
|
||||
{
|
||||
it = mFriendList.find(*fit);
|
||||
if (it == mFriendList.end())
|
||||
|
@ -1141,7 +1141,7 @@ bool p3discovery2::getDiscFriends(const RsPeerId& id, std::list<RsPeerId> &proxy
|
|||
|
||||
std::map<SSLID, DiscSslInfo>::const_iterator sit;
|
||||
for(sit = it->second.mSslIds.begin();
|
||||
sit != it->second.mSslIds.end(); sit++)
|
||||
sit != it->second.mSslIds.end(); ++sit)
|
||||
{
|
||||
proxyIds.push_back(sit->first);
|
||||
}
|
||||
|
@ -1169,7 +1169,7 @@ bool p3discovery2::getDiscPgpFriends(const PGPID &pgp_id, std::list<PGPID> &prox
|
|||
}
|
||||
|
||||
std::set<PGPID>::const_iterator fit;
|
||||
for(fit = it->second.mFriendSet.begin(); fit != it->second.mFriendSet.end(); fit++)
|
||||
for(fit = it->second.mFriendSet.begin(); fit != it->second.mFriendSet.end(); ++fit)
|
||||
{
|
||||
proxyPgpIds.push_back(*fit);
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ void p3Dsdv::advanceLocalSequenceNumbers()
|
|||
time_t now = time(NULL);
|
||||
|
||||
std::map<std::string, RsDsdvTableEntry>::iterator it;
|
||||
for(it = mTable.begin(); it != mTable.end(); it++)
|
||||
for(it = mTable.begin(); it != mTable.end(); ++it)
|
||||
{
|
||||
RsDsdvTableEntry &v = (it->second);
|
||||
if (v.mOwnSource)
|
||||
|
@ -179,7 +179,7 @@ void p3Dsdv::clearSignificantChangesFlags()
|
|||
RsStackMutex stack(mDsdvMtx); /****** LOCKED MUTEX *******/
|
||||
|
||||
std::map<std::string, RsDsdvTableEntry>::iterator it;
|
||||
for(it = mTable.begin(); it != mTable.end(); it++)
|
||||
for(it = mTable.begin(); it != mTable.end(); ++it)
|
||||
{
|
||||
RsDsdvTableEntry &v = (it->second);
|
||||
if (v.mFlags & RSDSDV_FLAGS_SIGNIFICANT_CHANGE)
|
||||
|
@ -211,7 +211,7 @@ int p3Dsdv::generateRoutingTables(bool incremental)
|
|||
|
||||
/* prepare packets */
|
||||
std::set<RsPeerId>::iterator it;
|
||||
for(it = idList.begin(); it != idList.end(); it++)
|
||||
for(it = idList.begin(); it != idList.end(); ++it)
|
||||
{
|
||||
#ifdef DEBUG_DSDV
|
||||
std::cerr << "p3Dsdv::generateRoutingTables() For: " << *it;
|
||||
|
@ -236,7 +236,7 @@ int p3Dsdv::generateRoutingTable(const RsPeerId &peerId, bool incremental)
|
|||
RsStackMutex stack(mDsdvMtx); /****** LOCKED MUTEX *******/
|
||||
|
||||
std::map<std::string, RsDsdvTableEntry>::iterator it;
|
||||
for(it = mTable.begin(); it != mTable.end(); it++)
|
||||
for(it = mTable.begin(); it != mTable.end(); ++it)
|
||||
{
|
||||
RsDsdvTableEntry &v = (it->second);
|
||||
|
||||
|
@ -331,8 +331,8 @@ int p3Dsdv::handleDSDV(RsDsdvRouteItem *dsdv)
|
|||
#endif
|
||||
|
||||
std::list<RsTlvDsdvEntry>::iterator it;
|
||||
//for(it = dsdv->routes.entries.begin(); it != dsdv->routes.entries.end(); it++)
|
||||
for(it = dsdv->routes.mList.begin(); it != dsdv->routes.mList.end(); it++)
|
||||
//for(it = dsdv->routes.entries.begin(); it != dsdv->routes.entries.end(); ++it)
|
||||
for(it = dsdv->routes.mList.begin(); it != dsdv->routes.mList.end(); ++it)
|
||||
{
|
||||
/* check for existing */
|
||||
RsTlvDsdvEntry &entry = *it;
|
||||
|
@ -471,7 +471,7 @@ int p3Dsdv::selectStableRoutes()
|
|||
|
||||
/* find the entry */
|
||||
std::map<std::string, RsDsdvTableEntry>::iterator tit;
|
||||
for(tit = mTable.begin(); tit != mTable.end(); tit++)
|
||||
for(tit = mTable.begin(); tit != mTable.end(); ++tit)
|
||||
{
|
||||
|
||||
#ifdef DEBUG_DSDV
|
||||
|
@ -497,7 +497,7 @@ int p3Dsdv::selectStableRoutes()
|
|||
|
||||
/* find newest sequence number */
|
||||
for(rit = tit->second.mAllRoutes.begin();
|
||||
rit != tit->second.mAllRoutes.end(); rit++)
|
||||
rit != tit->second.mAllRoutes.end(); ++rit)
|
||||
{
|
||||
if ((now - rit->second.mReceived <= DSDV_DISCARD_PERIOD) &&
|
||||
(rit->second.mSequence >= newest))
|
||||
|
@ -531,7 +531,7 @@ int p3Dsdv::selectStableRoutes()
|
|||
|
||||
/* find closest distance - with valid seq & max valid time */
|
||||
for(rit = tit->second.mAllRoutes.begin();
|
||||
rit != tit->second.mAllRoutes.end(); rit++)
|
||||
rit != tit->second.mAllRoutes.end(); ++rit)
|
||||
{
|
||||
/* Maximum difference in Sequence number is 2*DISTANCE
|
||||
* Otherwise it must be old.
|
||||
|
@ -617,7 +617,7 @@ int p3Dsdv::clearOldRoutes()
|
|||
|
||||
/* find the entry */
|
||||
std::map<std::string, RsDsdvTableEntry>::iterator it, it2;
|
||||
for(it = mTable.begin(); it != mTable.end(); it++)
|
||||
for(it = mTable.begin(); it != mTable.end(); ++it)
|
||||
{
|
||||
if (it->second.mOwnSource)
|
||||
{
|
||||
|
@ -652,7 +652,7 @@ int p3Dsdv::clearOldRoutes()
|
|||
void p3Dsdv::statusChange(const std::list<pqiServicePeer> &plist)
|
||||
{
|
||||
std::list<pqiServicePeer>::const_iterator it;
|
||||
for(it = plist.begin(); it != plist.end(); it++)
|
||||
for(it = plist.begin(); it != plist.end(); ++it)
|
||||
{
|
||||
/* only care about disconnected / not friends cases */
|
||||
if ( 1 )
|
||||
|
@ -676,8 +676,7 @@ int p3Dsdv::addTestService()
|
|||
std::string realHash;
|
||||
std::string seedHash;
|
||||
|
||||
int i;
|
||||
for(i = 0; i < SHA_DIGEST_LENGTH / 4; i++)
|
||||
for(int i = 0; i < SHA_DIGEST_LENGTH / 4; i++)
|
||||
{
|
||||
rndhash1[i] = RSRandom::random_u32();
|
||||
rndhash2[i] = RSRandom::random_u32();
|
||||
|
@ -796,7 +795,7 @@ int p3Dsdv::printDsdvTable(std::ostream &out)
|
|||
|
||||
/* iterate over the entries */
|
||||
std::map<std::string, RsDsdvTableEntry>::iterator it;
|
||||
for(it = mTable.begin(); it != mTable.end(); it++)
|
||||
for(it = mTable.begin(); it != mTable.end(); ++it)
|
||||
{
|
||||
RsDsdvTableEntry &v = it->second;
|
||||
out << v;
|
||||
|
@ -813,7 +812,7 @@ uint32_t p3Dsdv::getLocalServices(std::list<std::string> &hashes)
|
|||
|
||||
/* iterate over the entries */
|
||||
std::map<std::string, RsDsdvTableEntry>::iterator it;
|
||||
for(it = mTable.begin(); it != mTable.end(); it++)
|
||||
for(it = mTable.begin(); it != mTable.end(); ++it)
|
||||
{
|
||||
if (it->second.mOwnSource)
|
||||
{
|
||||
|
@ -830,7 +829,7 @@ uint32_t p3Dsdv::getAllServices(std::list<std::string> &hashes)
|
|||
|
||||
/* iterate over the entries */
|
||||
std::map<std::string, RsDsdvTableEntry>::iterator it;
|
||||
for(it = mTable.begin(); it != mTable.end(); it++)
|
||||
for(it = mTable.begin(); it != mTable.end(); ++it)
|
||||
{
|
||||
hashes.push_back(it->first);
|
||||
}
|
||||
|
@ -905,7 +904,7 @@ std::ostream &operator<<(std::ostream &out, const RsDsdvTableEntry &entry)
|
|||
}
|
||||
|
||||
std::map<RsPeerId, RsDsdvRoute>::const_iterator it;
|
||||
for(it = entry.mAllRoutes.begin(); it != entry.mAllRoutes.end(); it++)
|
||||
for(it = entry.mAllRoutes.begin(); it != entry.mAllRoutes.end(); ++it)
|
||||
{
|
||||
out << "\t\t" << it->second << std::endl;
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
std::list<RsGxsGroupId> unprocessedGroups;
|
||||
|
||||
std::vector<RsGxsNotify *>::iterator it;
|
||||
for(it = changes.begin(); it != changes.end(); it++)
|
||||
for(it = changes.begin(); it != changes.end(); ++it)
|
||||
{
|
||||
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
|
||||
if (msgChange && !msgChange->metaChange())
|
||||
|
@ -142,7 +142,7 @@ void p3GxsChannels::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgChangeMap = msgChange->msgChangeMap;
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::iterator mit;
|
||||
for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); mit++)
|
||||
for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); ++mit)
|
||||
{
|
||||
std::cerr << "p3GxsChannels::notifyChanges() Msgs for Group: " << mit->first;
|
||||
std::cerr << std::endl;
|
||||
|
@ -198,7 +198,7 @@ bool p3GxsChannels::getGroupData(const uint32_t &token, std::vector<RsGxsChannel
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsChannelGroupItem* item = dynamic_cast<RsGxsChannelGroupItem*>(*vit);
|
||||
if (item)
|
||||
|
@ -249,13 +249,13 @@ bool p3GxsChannels::getPostData(const uint32_t &token, std::vector<RsGxsChannelP
|
|||
{
|
||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
RsGxsGroupId grpId = mit->first;
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsChannelPostItem* item = dynamic_cast<RsGxsChannelPostItem*>(*vit);
|
||||
|
||||
|
@ -296,12 +296,12 @@ bool p3GxsChannels::getRelatedPosts(const uint32_t &token, std::vector<RsGxsChan
|
|||
{
|
||||
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsChannelPostItem* item = dynamic_cast<RsGxsChannelPostItem*>(*vit);
|
||||
|
||||
|
@ -413,7 +413,7 @@ void p3GxsChannels::load_SubscribedGroups(const uint32_t &token)
|
|||
getGroupMeta(token, groups);
|
||||
|
||||
std::list<RsGroupMetaData>::iterator it;
|
||||
for(it = groups.begin(); it != groups.end(); it++)
|
||||
for(it = groups.begin(); it != groups.end(); ++it)
|
||||
{
|
||||
if (it->mSubscribeFlags &
|
||||
(GXS_SERV::GROUP_SUBSCRIBE_ADMIN |
|
||||
|
@ -508,7 +508,7 @@ void p3GxsChannels::request_SpecificUnprocessedPosts(std::list<std::pair<RsGxsGr
|
|||
/* organise Ids how they want them */
|
||||
GxsMsgReq msgIds;
|
||||
std::list<std::pair<RsGxsGroupId, RsGxsMessageId> >::iterator it;
|
||||
for(it = ids.begin(); it != ids.end(); it++)
|
||||
for(it = ids.begin(); it != ids.end(); ++it)
|
||||
{
|
||||
std::vector<RsGxsMessageId> &vect_msgIds = msgIds[it->first];
|
||||
vect_msgIds.push_back(it->second);
|
||||
|
@ -556,7 +556,7 @@ void p3GxsChannels::load_SpecificUnprocessedPosts(const uint32_t &token)
|
|||
|
||||
|
||||
std::vector<RsGxsChannelPost>::iterator it;
|
||||
for(it = posts.begin(); it != posts.end(); it++)
|
||||
for(it = posts.begin(); it != posts.end(); ++it)
|
||||
{
|
||||
/* autodownload the files */
|
||||
handleUnprocessedPost(*it);
|
||||
|
@ -579,7 +579,7 @@ void p3GxsChannels::load_GroupUnprocessedPosts(const uint32_t &token)
|
|||
|
||||
|
||||
std::vector<RsGxsChannelPost>::iterator it;
|
||||
for(it = posts.begin(); it != posts.end(); it++)
|
||||
for(it = posts.begin(); it != posts.end(); ++it)
|
||||
{
|
||||
handleUnprocessedPost(*it);
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg)
|
|||
std::cerr << std::endl;
|
||||
|
||||
std::list<RsGxsFile>::const_iterator fit;
|
||||
for(fit = msg.mFiles.begin(); fit != msg.mFiles.end(); fit++)
|
||||
for(fit = msg.mFiles.begin(); fit != msg.mFiles.end(); ++fit)
|
||||
{
|
||||
std::string fname = fit->mName;
|
||||
Sha1CheckSum hash = Sha1CheckSum(fit->mHash);
|
||||
|
@ -1166,7 +1166,7 @@ bool p3GxsChannels::generateComment(uint32_t &token, const RsGxsGroupId &grpId,
|
|||
|
||||
uint32_t idx = (uint32_t) (ownIds.size() * RSRandom::random_f32());
|
||||
uint32_t i = 0;
|
||||
for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); it++, i++);
|
||||
for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); ++it, ++i);
|
||||
|
||||
if (it != ownIds.end())
|
||||
{
|
||||
|
@ -1203,7 +1203,7 @@ bool p3GxsChannels::generateVote(uint32_t &token, const RsGxsGroupId &grpId, con
|
|||
|
||||
uint32_t idx = (uint32_t) (ownIds.size() * RSRandom::random_f32());
|
||||
uint32_t i = 0;
|
||||
for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); it++, i++) ;
|
||||
for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); ++it, ++i) ;
|
||||
|
||||
if (it != ownIds.end())
|
||||
{
|
||||
|
|
|
@ -180,7 +180,7 @@ void p3GxsCircles::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
#endif
|
||||
|
||||
std::vector<RsGxsNotify *>::iterator it;
|
||||
for(it = changes.begin(); it != changes.end(); it++)
|
||||
for(it = changes.begin(); it != changes.end(); ++it)
|
||||
{
|
||||
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
|
||||
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
|
||||
|
@ -193,7 +193,7 @@ void p3GxsCircles::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgChangeMap = msgChange->msgChangeMap;
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::iterator mit;
|
||||
for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); mit++)
|
||||
for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); ++mit)
|
||||
{
|
||||
#ifdef DEBUG_CIRCLES
|
||||
std::cerr << "p3GxsCircles::notifyChanges() Msgs for Group: " << mit->first;
|
||||
|
@ -212,7 +212,7 @@ void p3GxsCircles::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
|
||||
std::list<RsGxsGroupId> &groupList = groupChange->mGrpIdList;
|
||||
std::list<RsGxsGroupId>::iterator git;
|
||||
for(git = groupList.begin(); git != groupList.end(); git++)
|
||||
for(git = groupList.begin(); git != groupList.end(); ++git)
|
||||
{
|
||||
#ifdef DEBUG_CIRCLES
|
||||
std::cerr << "p3GxsCircles::notifyChanges() Incoming Group: " << *git;
|
||||
|
@ -290,7 +290,7 @@ bool p3GxsCircles:: getCirclePersonalIdList(std::list<RsGxsCircleId> &circleIds)
|
|||
else
|
||||
{
|
||||
std::list<RsGxsCircleId>::const_iterator it;
|
||||
for(it = mCirclePersonalIdList.begin(); it != mCirclePersonalIdList.begin(); it++)
|
||||
for(it = mCirclePersonalIdList.begin(); it != mCirclePersonalIdList.begin(); ++it)
|
||||
{
|
||||
circleIds.push_back(*it);
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ bool p3GxsCircles:: getCircleExternalIdList(std::list<RsGxsCircleId> &circleIds)
|
|||
else
|
||||
{
|
||||
std::list<RsGxsCircleId>::const_iterator it;
|
||||
for(it = mCircleExternalIdList.begin(); it != mCircleExternalIdList.begin(); it++)
|
||||
for(it = mCircleExternalIdList.begin(); it != mCircleExternalIdList.begin(); ++it)
|
||||
{
|
||||
circleIds.push_back(*it);
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ bool p3GxsCircles::getGroupData(const uint32_t &token, std::vector<RsGxsCircleGr
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsCircleGroupItem* item = dynamic_cast<RsGxsCircleGroupItem*>(*vit);
|
||||
if (item)
|
||||
|
@ -536,7 +536,7 @@ bool RsGxsCircleCache::loadSubCircle(const RsGxsCircleCache &subcircle)
|
|||
bool RsGxsCircleCache::getAllowedPeersList(std::list<RsPgpId> &friendlist)
|
||||
{
|
||||
std::map<RsPgpId, std::list<RsGxsId> >::iterator it;
|
||||
for(it = mAllowedPeers.begin(); it != mAllowedPeers.end(); it++)
|
||||
for(it = mAllowedPeers.begin(); it != mAllowedPeers.end(); ++it)
|
||||
{
|
||||
friendlist.push_back(it->first);
|
||||
}
|
||||
|
@ -613,7 +613,7 @@ bool p3GxsCircles::load_CircleIdList(uint32_t token)
|
|||
mCircleExternalIdList.clear();
|
||||
}
|
||||
|
||||
for(std::list<RsGroupMetaData>::iterator it = groups.begin(); it != groups.end(); it++)
|
||||
for(std::list<RsGroupMetaData>::iterator it = groups.begin(); it != groups.end(); ++it)
|
||||
{
|
||||
addCircleIdToList(RsGxsCircleId(it->mGroupId), it->mCircleType);
|
||||
}
|
||||
|
@ -667,7 +667,7 @@ bool p3GxsCircles::cachetest_handlerequest(uint32_t token)
|
|||
if(ok)
|
||||
{
|
||||
std::list<RsGxsId>::iterator vit = grpIds.begin();
|
||||
for(; vit != grpIds.end(); vit++)
|
||||
for(; vit != grpIds.end(); ++vit)
|
||||
{
|
||||
/* 5% chance of checking it! */
|
||||
if (RSRandom::random_f32() < 0.25)
|
||||
|
@ -816,7 +816,7 @@ bool p3GxsCircles::cache_start_load()
|
|||
|
||||
/* now we process the modGroupList -> a map so we can use it easily later, and create id list too */
|
||||
std::list<RsGxsCircleId>::iterator it;
|
||||
for(it = mCacheLoad_ToCache.begin(); it != mCacheLoad_ToCache.end(); it++)
|
||||
for(it = mCacheLoad_ToCache.begin(); it != mCacheLoad_ToCache.end(); ++it)
|
||||
{
|
||||
#ifdef DEBUG_CIRCLES
|
||||
std::cerr << "p3GxsCircles::cache_start_load() GroupId: " << *it;
|
||||
|
@ -862,7 +862,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token)
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsCircleGroupItem *item = dynamic_cast<RsGxsCircleGroupItem*>(*vit);
|
||||
if (!item)
|
||||
|
@ -917,7 +917,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token)
|
|||
std::list<RsGxsId>::const_iterator pit;
|
||||
|
||||
// need to trigger the searches.
|
||||
for(pit = peers.begin(); pit != peers.end(); pit++)
|
||||
for(pit = peers.begin(); pit != peers.end(); ++pit)
|
||||
{
|
||||
#ifdef DEBUG_CIRCLES
|
||||
std::cerr << "p3GxsCircles::cache_load_for_token() Invited Member: " << *pit;
|
||||
|
@ -978,7 +978,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token)
|
|||
#if 0
|
||||
std::list<RsGxsCircleId> &circles = group.mSubCircles;
|
||||
std::list<RsGxsCircleId>::const_iterator cit;
|
||||
for(cit = circles.begin(); cit != circles.end(); cit++)
|
||||
for(cit = circles.begin(); cit != circles.end(); ++cit)
|
||||
{
|
||||
/* if its cached already -> then its complete. */
|
||||
if (mCircleCache.is_loaded(*cit))
|
||||
|
@ -1022,7 +1022,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token)
|
|||
std::list<RsPgpId>::const_iterator pit;
|
||||
|
||||
// need to trigger the searches.
|
||||
for(pit = peers.begin(); pit != peers.end(); pit++)
|
||||
for(pit = peers.begin(); pit != peers.end(); ++pit)
|
||||
{
|
||||
#ifdef DEBUG_CIRCLES
|
||||
std::cerr << "p3GxsCircles::cache_load_for_token() Local Friend: " << *pit;
|
||||
|
@ -1105,7 +1105,7 @@ bool p3GxsCircles::cache_reloadids(const RsGxsCircleId &circleId)
|
|||
/* try reload Ids */
|
||||
std::set<RsGxsId>::const_iterator pit;
|
||||
for(pit = cache.mUnprocessedPeers.begin();
|
||||
pit != cache.mUnprocessedPeers.end(); pit++)
|
||||
pit != cache.mUnprocessedPeers.end(); ++pit)
|
||||
{
|
||||
/* check cache */
|
||||
if (mIdentities->haveKey(*pit))
|
||||
|
@ -1294,7 +1294,7 @@ bool p3GxsCircles::cache_load_subcircles(uint32_t token)
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*vit);
|
||||
|
||||
|
@ -1337,7 +1337,7 @@ bool p3GxsCircles::cache_load_subcircles(uint32_t token)
|
|||
std::list<RsGxsId>::const_iterator pit;
|
||||
|
||||
// need to trigger the searches.
|
||||
for(pit = peers.begin(); pit != peers.end(); pit++)
|
||||
for(pit = peers.begin(); pit != peers.end(); ++pit)
|
||||
{
|
||||
/* check cache */
|
||||
if (mIdentities->is_cached(*pit))
|
||||
|
@ -1352,7 +1352,7 @@ bool p3GxsCircles::cache_load_subcircles(uint32_t token)
|
|||
// TODO.
|
||||
//cache.mAllowedPeers[details.mPgpId] = *pit;
|
||||
|
||||
for(uit = updateCaches.begin(); uit != updateCaches.end(); uit++)
|
||||
for(uit = updateCaches.begin(); uit != updateCaches.end(); ++uit)
|
||||
{
|
||||
/* fetch the cache - and update */
|
||||
mLoadingCache[id] = RsGxsCircleCache();
|
||||
|
@ -1387,7 +1387,7 @@ bool p3GxsCircles::cache_load_subcircles(uint32_t token)
|
|||
|
||||
std::list<RsGxsCircleId> &circles = group.circles;
|
||||
std::list<RsGxsCircleId>::const_iterator cit;
|
||||
for(cit = circles.begin(); cit != circles.end(); cit++)
|
||||
for(cit = circles.begin(); cit != circles.end(); ++cit)
|
||||
{
|
||||
/* if its cached already -> then its complete. */
|
||||
if (mCircleCache.is_loaded(*cit))
|
||||
|
@ -1514,7 +1514,7 @@ void p3GxsCircles::checkDummyIdData()
|
|||
}
|
||||
|
||||
std::vector<RsGxsIdGroup>::iterator it;
|
||||
for(it = ids.begin(); it != ids.end(); it++)
|
||||
for(it = ids.begin(); it != ids.end(); ++it)
|
||||
{
|
||||
if (it->mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
||||
{
|
||||
|
@ -1580,7 +1580,7 @@ void p3GxsCircles::generateDummyCircle()
|
|||
|
||||
int selection = (RSRandom::random_u32() % npgps);
|
||||
std::list<RsGxsId>::iterator it = mDummyPgpLinkedIds.begin();
|
||||
for(int j = 0; (it != mDummyPgpLinkedIds.end()) && (j < selection); j++, it++) ;
|
||||
for(int j = 0; (it != mDummyPgpLinkedIds.end()) && (j < selection); j++, ++it) ;
|
||||
if (it != mDummyPgpLinkedIds.end())
|
||||
{
|
||||
idset.insert(*it);
|
||||
|
@ -1594,7 +1594,7 @@ void p3GxsCircles::generateDummyCircle()
|
|||
int selection = (RSRandom::random_u32() % mDummyOwnIds.size());
|
||||
std::list<RsGxsId>::iterator it = mDummyOwnIds.begin();
|
||||
mDummyOwnIds.push_back(*it);
|
||||
for(int j = 0; (it != mDummyOwnIds.end()) && (j < selection); j++, it++) ;
|
||||
for(int j = 0; (it != mDummyOwnIds.end()) && (j < selection); j++, ++it) ;
|
||||
if (it != mDummyOwnIds.end())
|
||||
{
|
||||
idset.insert(*it);
|
||||
|
@ -1608,7 +1608,7 @@ void p3GxsCircles::generateDummyCircle()
|
|||
#endif // DEBUG_CIRCLES
|
||||
|
||||
std::set<RsGxsId>::iterator it;
|
||||
for(it = idset.begin(); it != idset.end(); it++)
|
||||
for(it = idset.begin(); it != idset.end(); ++it)
|
||||
{
|
||||
group.mInvitedMembers.push_back(*it);
|
||||
#ifdef DEBUG_CIRCLES
|
||||
|
@ -1637,14 +1637,14 @@ std::ostream &operator<<(std::ostream &out, const RsGxsCircleGroup &grp)
|
|||
std::list<RsGxsId>::const_iterator it;
|
||||
std::list<RsGxsCircleId>::const_iterator sit;
|
||||
for(it = grp.mInvitedMembers.begin();
|
||||
it != grp.mInvitedMembers.begin(); it++)
|
||||
it != grp.mInvitedMembers.begin(); ++it)
|
||||
{
|
||||
out << "\t" << *it;
|
||||
out << std::endl;
|
||||
}
|
||||
|
||||
for(sit = grp.mSubCircles.begin();
|
||||
sit != grp.mSubCircles.begin(); sit++)
|
||||
sit != grp.mSubCircles.begin(); ++sit)
|
||||
{
|
||||
out << "\t" << *it;
|
||||
out << std::endl;
|
||||
|
|
|
@ -178,7 +178,7 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector<R
|
|||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
std::multimap<RsGxsMessageId, RsGxsVoteItem *> voteMap;
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
RsGxsGroupId grpId = mit->first;
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
|
@ -186,7 +186,7 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector<R
|
|||
|
||||
/* now split into Comments and Votes */
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsCommentItem* item = dynamic_cast<RsGxsCommentItem*>(*vit);
|
||||
|
||||
|
@ -216,9 +216,9 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector<R
|
|||
/* now iterate through comments - and set the vote counts */
|
||||
std::vector<RsGxsComment>::iterator cit;
|
||||
std::multimap<RsGxsMessageId, RsGxsVoteItem *>::iterator it;
|
||||
for(cit = comments.begin(); cit != comments.end(); cit++)
|
||||
for(cit = comments.begin(); cit != comments.end(); ++cit)
|
||||
{
|
||||
for (it = voteMap.lower_bound(cit->mMeta.mMsgId); it != voteMap.upper_bound(cit->mMeta.mMsgId); it++)
|
||||
for (it = voteMap.lower_bound(cit->mMeta.mMsgId); it != voteMap.upper_bound(cit->mMeta.mMsgId); ++it)
|
||||
{
|
||||
if (it->second->mMsg.mVoteType == GXS_VOTE_UP)
|
||||
{
|
||||
|
@ -255,7 +255,7 @@ bool p3GxsCommentService::getGxsCommentData(const uint32_t &token, std::vector<R
|
|||
std::cerr << std::endl;
|
||||
|
||||
/* delete the votes */
|
||||
for (it = voteMap.begin(); it != voteMap.end(); it++)
|
||||
for (it = voteMap.begin(); it != voteMap.end(); ++it)
|
||||
{
|
||||
delete it->second;
|
||||
}
|
||||
|
@ -283,12 +283,12 @@ bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vect
|
|||
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
|
||||
std::multimap<RsGxsMessageId, RsGxsVoteItem *> voteMap;
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsCommentItem* item = dynamic_cast<RsGxsCommentItem*>(*vit);
|
||||
|
||||
|
@ -318,9 +318,9 @@ bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vect
|
|||
/* now iterate through comments - and set the vote counts */
|
||||
std::vector<RsGxsComment>::iterator cit;
|
||||
std::multimap<RsGxsMessageId, RsGxsVoteItem *>::iterator it;
|
||||
for(cit = comments.begin(); cit != comments.end(); cit++)
|
||||
for(cit = comments.begin(); cit != comments.end(); ++cit)
|
||||
{
|
||||
for (it = voteMap.lower_bound(cit->mMeta.mMsgId); it != voteMap.upper_bound(cit->mMeta.mMsgId); it++)
|
||||
for (it = voteMap.lower_bound(cit->mMeta.mMsgId); it != voteMap.upper_bound(cit->mMeta.mMsgId); ++it)
|
||||
{
|
||||
if (it->second->mMsg.mVoteType == GXS_VOTE_UP)
|
||||
{
|
||||
|
@ -357,7 +357,7 @@ bool p3GxsCommentService::getGxsRelatedComments(const uint32_t &token, std::vect
|
|||
std::cerr << std::endl;
|
||||
|
||||
/* delete the votes */
|
||||
for (it = voteMap.begin(); it != voteMap.end(); it++)
|
||||
for (it = voteMap.begin(); it != voteMap.end(); ++it)
|
||||
{
|
||||
delete it->second;
|
||||
}
|
||||
|
@ -497,10 +497,10 @@ void p3GxsCommentService::load_PendingVoteParent(const uint32_t &token)
|
|||
}
|
||||
|
||||
GxsMsgMetaMap::iterator it;
|
||||
for(it = msginfo.begin(); it != msginfo.end(); it++)
|
||||
for(it = msginfo.begin(); it != msginfo.end(); ++it)
|
||||
{
|
||||
std::vector<RsMsgMetaData>::iterator mit;
|
||||
for(mit = it->second.begin(); mit != it->second.end(); mit++)
|
||||
for(mit = it->second.begin(); mit != it->second.end(); ++mit)
|
||||
{
|
||||
/* find the matching Pending Vote */
|
||||
RsMsgMetaData &meta = *mit;
|
||||
|
@ -567,7 +567,7 @@ void p3GxsCommentService::completeInternalVote(uint32_t &token)
|
|||
std::cerr << "p3GxsCommentService::completeInternalVote() token: " << token;
|
||||
std::cerr << std::endl;
|
||||
std::map<RsGxsGrpMsgIdPair, VoteHolder>::iterator it;
|
||||
for (it = mPendingVotes.begin(); it != mPendingVotes.end(); it++)
|
||||
for (it = mPendingVotes.begin(); it != mPendingVotes.end(); ++it)
|
||||
{
|
||||
if (it->second.mVoteToken == token)
|
||||
{
|
||||
|
@ -596,7 +596,7 @@ bool p3GxsCommentService::acknowledgeVote(const uint32_t& token, RsGxsGrpMsgIdPa
|
|||
std::cerr << std::endl;
|
||||
|
||||
std::map<RsGxsGrpMsgIdPair, VoteHolder>::iterator it;
|
||||
for (it = mPendingVotes.begin(); it != mPendingVotes.end(); it++)
|
||||
for (it = mPendingVotes.begin(); it != mPendingVotes.end(); ++it)
|
||||
{
|
||||
if (it->second.mReqToken == token)
|
||||
{
|
||||
|
|
|
@ -117,7 +117,7 @@ bool p3GxsForums::getGroupData(const uint32_t &token, std::vector<RsGxsForumGrou
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsForumGroupItem* item = dynamic_cast<RsGxsForumGroupItem*>(*vit);
|
||||
if (item)
|
||||
|
@ -152,13 +152,13 @@ bool p3GxsForums::getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &
|
|||
{
|
||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
RsGxsGroupId grpId = mit->first;
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsForumMsgItem* item = dynamic_cast<RsGxsForumMsgItem*>(*vit);
|
||||
|
||||
|
@ -191,12 +191,12 @@ bool p3GxsForums::getRelatedMessages(const uint32_t &token, std::vector<RsGxsFor
|
|||
{
|
||||
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsForumMsgItem* item = dynamic_cast<RsGxsForumMsgItem*>(*vit);
|
||||
|
||||
|
@ -456,7 +456,7 @@ bool p3GxsForums::generateMessage(uint32_t &token, const RsGxsGroupId &grpId, co
|
|||
|
||||
uint32_t idx = (uint32_t) (ownIds.size() * RSRandom::random_f32());
|
||||
int i = 0;
|
||||
for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); it++, i++) ;
|
||||
for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); ++it, i++) ;
|
||||
|
||||
if (it != ownIds.end())
|
||||
{
|
||||
|
|
|
@ -253,7 +253,7 @@ bool p3GxsReputation::SendReputations(RsGxsReputationRequestItem *request)
|
|||
int totalcount = 0;
|
||||
RsGxsReputationUpdateItem *pkt = new RsGxsReputationUpdateItem();
|
||||
pkt->PeerId(peerId);
|
||||
for(;tit != mUpdated.end(); tit++)
|
||||
for(;tit != mUpdated.end(); ++tit)
|
||||
{
|
||||
/* find */
|
||||
std::map<RsGxsId, Reputation>::iterator rit;
|
||||
|
@ -326,7 +326,7 @@ bool p3GxsReputation::RecvReputations(RsGxsReputationUpdateItem *item)
|
|||
RsPeerId peerid = item->PeerId();
|
||||
|
||||
std::map<RsGxsId, uint32_t>::iterator it;
|
||||
for(it = item->mOpinions.begin(); it != item->mOpinions.end(); it++)
|
||||
for(it = item->mOpinions.begin(); it != item->mOpinions.end(); ++it)
|
||||
{
|
||||
RsStackMutex stack(mReputationMtx); /****** LOCKED MUTEX *******/
|
||||
|
||||
|
@ -406,7 +406,7 @@ bool p3GxsReputation::updateOpinion(const RsGxsId& gxsid, int opinion)
|
|||
std::multimap<time_t, RsGxsId>::iterator uit, euit;
|
||||
uit = mUpdated.lower_bound(reputation.mOwnOpinionTs);
|
||||
euit = mUpdated.upper_bound(reputation.mOwnOpinionTs);
|
||||
for(; uit != euit; uit++)
|
||||
for(; uit != euit; ++uit)
|
||||
{
|
||||
if (uit->second == gxsid)
|
||||
{
|
||||
|
@ -449,7 +449,7 @@ bool p3GxsReputation::saveList(bool& cleanup, std::list<RsItem*> &savelist)
|
|||
|
||||
/* save */
|
||||
std::map<RsPeerId, ReputationConfig>::iterator it;
|
||||
for(it = mConfig.begin(); it != mConfig.end(); it++)
|
||||
for(it = mConfig.begin(); it != mConfig.end(); ++it)
|
||||
{
|
||||
if (!rsPeers->isFriend(it->first))
|
||||
{
|
||||
|
@ -466,7 +466,7 @@ bool p3GxsReputation::saveList(bool& cleanup, std::list<RsItem*> &savelist)
|
|||
|
||||
int count = 0;
|
||||
std::map<RsGxsId, Reputation>::iterator rit;
|
||||
for(rit = mReputations.begin(); rit != mReputations.end(); rit++, count++)
|
||||
for(rit = mReputations.begin(); rit != mReputations.end(); ++rit, count++)
|
||||
{
|
||||
RsGxsReputationSetItem *item = new RsGxsReputationSetItem();
|
||||
item->mGxsId = rit->first.toStdString();
|
||||
|
@ -497,7 +497,7 @@ bool p3GxsReputation::loadList(std::list<RsItem *>& loadList)
|
|||
std::list<RsItem *>::iterator it;
|
||||
std::set<RsPeerId> peerSet;
|
||||
|
||||
for(it = loadList.begin(); it != loadList.end(); it++)
|
||||
for(it = loadList.begin(); it != loadList.end(); ++it)
|
||||
{
|
||||
RsGxsReputationConfigItem *item = dynamic_cast<RsGxsReputationConfigItem *>(*it);
|
||||
// Configurations are loaded first. (to establish peerSet).
|
||||
|
@ -542,7 +542,7 @@ bool p3GxsReputation::loadReputationSet(RsGxsReputationSetItem *item, const std:
|
|||
|
||||
// install opinions.
|
||||
std::map<std::string, uint32_t>::const_iterator oit;
|
||||
for(oit = item->mOpinions.begin(); oit != item->mOpinions.end(); oit++)
|
||||
for(oit = item->mOpinions.begin(); oit != item->mOpinions.end(); ++oit)
|
||||
{
|
||||
// expensive ... but necessary.
|
||||
RsPeerId peerId(oit->first);
|
||||
|
@ -635,7 +635,7 @@ void p3GxsReputation::sendReputationRequests()
|
|||
|
||||
/* prepare packets */
|
||||
std::list<RsPeerId>::iterator it;
|
||||
for(it = idList.begin(); it != idList.end(); it++)
|
||||
for(it = idList.begin(); it != idList.end(); ++it)
|
||||
{
|
||||
#ifdef DEBUG_REPUTATION
|
||||
std::cerr << "p3GxsReputation::sendReputationRequest() To: " << *it;
|
||||
|
|
|
@ -220,7 +220,7 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
std::list<RsGxsGroupId> unprocessedGroups;
|
||||
|
||||
std::vector<RsGxsNotify *>::iterator it;
|
||||
for(it = changes.begin(); it != changes.end(); it++)
|
||||
for(it = changes.begin(); it != changes.end(); ++it)
|
||||
{
|
||||
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
|
||||
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
|
||||
|
@ -233,7 +233,7 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgChangeMap = msgChange->msgChangeMap;
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::iterator mit;
|
||||
for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); mit++)
|
||||
for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); ++mit)
|
||||
{
|
||||
#ifdef DEBUG_IDS
|
||||
std::cerr << "p3IdService::notifyChanges() Msgs for Group: " << mit->first;
|
||||
|
@ -252,7 +252,7 @@ void p3IdService::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
|
||||
std::list<RsGxsGroupId> &groupList = groupChange->mGrpIdList;
|
||||
std::list<RsGxsGroupId>::iterator git;
|
||||
for(git = groupList.begin(); git != groupList.end(); git++)
|
||||
for(git = groupList.begin(); git != groupList.end(); ++git)
|
||||
{
|
||||
#ifdef DEBUG_IDS
|
||||
std::cerr << "p3IdService::notifyChanges() Auto Subscribe to Incoming Groups: " << *git;
|
||||
|
@ -715,7 +715,7 @@ bool p3IdService::getGroupData(const uint32_t &token, std::vector<RsGxsIdGroup>
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*vit);
|
||||
if (item)
|
||||
|
@ -1309,7 +1309,7 @@ void RsGxsIdCache::updateServiceString(std::string serviceString)
|
|||
{
|
||||
std::list<RsRecognTag>::iterator it;
|
||||
int i = 0;
|
||||
for(it = mRecognTags.begin(); it != mRecognTags.end(); it++, i++)
|
||||
for(it = mRecognTags.begin(); it != mRecognTags.end(); ++it, i++)
|
||||
{
|
||||
if (ssdata.recogntags.tagValid(i) && it->valid)
|
||||
{
|
||||
|
@ -1369,7 +1369,7 @@ bool p3IdService::recogn_extract_taginfo(const RsGxsIdGroupItem *item, std::list
|
|||
|
||||
std::list<std::string>::const_iterator rit;
|
||||
int count = 0;
|
||||
for(rit = item->group.mRecognTags.begin(); rit != item->group.mRecognTags.end(); rit++)
|
||||
for(rit = item->group.mRecognTags.begin(); rit != item->group.mRecognTags.end(); ++rit)
|
||||
{
|
||||
if (++count > RSRECOGN_MAX_TAGINFO)
|
||||
{
|
||||
|
@ -1453,7 +1453,7 @@ bool p3IdService::cache_process_recogntaginfo(const RsGxsIdGroupItem *item, std:
|
|||
recogn_extract_taginfo(item, tagItems);
|
||||
|
||||
//time_t now = time(NULL);
|
||||
for(it = tagItems.begin(); it != tagItems.end(); it++)
|
||||
for(it = tagItems.begin(); it != tagItems.end(); ++it)
|
||||
{
|
||||
RsRecognTag info((*it)->tag_class, (*it)->tag_type, false);
|
||||
bool isPending = false;
|
||||
|
@ -1522,7 +1522,7 @@ bool p3IdService::cache_store(const RsGxsIdGroupItem *item)
|
|||
//std::cerr << "p3IdService::cache_store() KeySet is:";
|
||||
//keySet.print(std::cerr, 10);
|
||||
|
||||
for (kit = keySet.keys.begin(); kit != keySet.keys.end(); kit++)
|
||||
for (kit = keySet.keys.begin(); kit != keySet.keys.end(); ++kit)
|
||||
{
|
||||
if (kit->second.keyFlags & RSTLV_KEY_DISTRIB_ADMIN)
|
||||
{
|
||||
|
@ -1624,7 +1624,7 @@ bool p3IdService::cache_start_load()
|
|||
|
||||
/* now we process the modGroupList -> a map so we can use it easily later, and create id list too */
|
||||
std::map<RsGxsId, std::list<RsPeerId> >::iterator it;
|
||||
for(it = mCacheLoad_ToCache.begin(); it != mCacheLoad_ToCache.end(); it++)
|
||||
for(it = mCacheLoad_ToCache.begin(); it != mCacheLoad_ToCache.end(); ++it)
|
||||
{
|
||||
#ifdef DEBUG_IDS
|
||||
std::cerr << "p3IdService::cache_start_load() GroupId: " << it->first;
|
||||
|
@ -1670,7 +1670,7 @@ bool p3IdService::cache_load_for_token(uint32_t token)
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*vit);
|
||||
if (!item)
|
||||
|
@ -1728,7 +1728,7 @@ void p3IdService::requestIdsFromNet()
|
|||
std::map<RsPeerId, std::list<RsGxsId> > requests;
|
||||
|
||||
// transform to appropriate structure (<peer, std::list<RsGxsId> > map) to make request to nes
|
||||
for(cit = mIdsNotPresent.begin(); cit != mIdsNotPresent.end(); cit++)
|
||||
for(cit = mIdsNotPresent.begin(); cit != mIdsNotPresent.end(); ++cit)
|
||||
{
|
||||
{
|
||||
#ifdef DEBUG_IDS
|
||||
|
@ -1741,20 +1741,20 @@ void p3IdService::requestIdsFromNet()
|
|||
|
||||
const std::list<RsPeerId>& peers = cit->second;
|
||||
std::list<RsPeerId>::const_iterator cit2;
|
||||
for(cit2 = peers.begin(); cit2 != peers.end(); cit2++)
|
||||
for(cit2 = peers.begin(); cit2 != peers.end(); ++cit2)
|
||||
requests[*cit2].push_back(cit->first);
|
||||
}
|
||||
|
||||
std::map<RsPeerId, std::list<RsGxsId> >::const_iterator cit2;
|
||||
|
||||
for(cit2 = requests.begin(); cit2 != requests.end(); cit2++)
|
||||
for(cit2 = requests.begin(); cit2 != requests.end(); ++cit2)
|
||||
{
|
||||
|
||||
if(mNes)
|
||||
{
|
||||
std::list<RsGxsId>::const_iterator gxs_id_it = cit2->second.begin();
|
||||
std::list<RsGxsGroupId> grpIds;
|
||||
for(; gxs_id_it != cit2->second.end(); gxs_id_it++)
|
||||
for(; gxs_id_it != cit2->second.end(); ++gxs_id_it)
|
||||
grpIds.push_back(RsGxsGroupId(gxs_id_it->toStdString()));
|
||||
|
||||
mNes->requestGrp(grpIds, cit2->first);
|
||||
|
@ -1847,7 +1847,7 @@ bool p3IdService::cache_load_ownids(uint32_t token)
|
|||
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
mOwnIds.clear();
|
||||
for(vit = grpData.begin(); vit != grpData.end(); vit++)
|
||||
for(vit = grpData.begin(); vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*vit);
|
||||
if (!item)
|
||||
|
@ -1869,7 +1869,7 @@ bool p3IdService::cache_load_ownids(uint32_t token)
|
|||
// as it just causes the cache to be flushed.
|
||||
#if 0
|
||||
// Cache Items too.
|
||||
for(vit = grpData.begin(); vit != grpData.end(); vit++)
|
||||
for(vit = grpData.begin(); vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*vit);
|
||||
if (item->meta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN)
|
||||
|
@ -1932,13 +1932,13 @@ bool p3IdService::cachetest_handlerequest(uint32_t token)
|
|||
bool ok = RsGenExchange::getGroupList(token, grpIdsC);
|
||||
|
||||
std::list<RsGxsGroupId>::const_iterator cit = grpIdsC.begin();
|
||||
for(; cit != grpIdsC.end(); cit++)
|
||||
for(; cit != grpIdsC.end(); ++cit)
|
||||
grpIds.push_back(RsGxsId(cit->toStdString()));
|
||||
|
||||
if(ok)
|
||||
{
|
||||
std::list<RsGxsId>::iterator vit = grpIds.begin();
|
||||
for(; vit != grpIds.end(); vit++)
|
||||
for(; vit != grpIds.end(); ++vit)
|
||||
{
|
||||
/* 5% chance of checking it! */
|
||||
if (RSRandom::random_f32() < 0.25)
|
||||
|
@ -2136,7 +2136,7 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte
|
|||
/********************* TEMP HACK UNTIL GXS FILLS IN GROUP_ID *****************/
|
||||
// find private admin key
|
||||
std::map<RsGxsId, RsTlvSecurityKey>::iterator mit = keySet.keys.begin();
|
||||
for(; mit != keySet.keys.end(); mit++)
|
||||
for(; mit != keySet.keys.end(); ++mit)
|
||||
{
|
||||
RsTlvSecurityKey& pk = mit->second;
|
||||
|
||||
|
@ -2369,7 +2369,7 @@ bool p3IdService::pgphash_handlerequest(uint32_t token)
|
|||
#endif // DEBUG_IDS
|
||||
|
||||
std::vector<RsGxsIdGroup>::iterator vit;
|
||||
for(vit = groups.begin(); vit != groups.end(); vit++)
|
||||
for(vit = groups.begin(); vit != groups.end(); ++vit)
|
||||
{
|
||||
#ifdef DEBUG_IDS
|
||||
std::cerr << "p3IdService::pgphash_request() Group Id: " << vit->mMeta.mGroupId;
|
||||
|
@ -2562,7 +2562,7 @@ bool p3IdService::checkId(const RsGxsIdGroup &grp, RsPgpId &pgpId)
|
|||
RsStackMutex stack(mIdMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
std::map<RsPgpId, PGPFingerprintType>::iterator mit;
|
||||
for(mit = mPgpFingerprintMap.begin(); mit != mPgpFingerprintMap.end(); mit++)
|
||||
for(mit = mPgpFingerprintMap.begin(); mit != mPgpFingerprintMap.end(); ++mit)
|
||||
{
|
||||
Sha1CheckSum hash;
|
||||
calcPGPHash(RsGxsId(grp.mMeta.mGroupId.toStdString()), mit->second, hash);
|
||||
|
@ -2636,7 +2636,7 @@ void p3IdService::getPgpIdList()
|
|||
mPgpFingerprintMap.clear();
|
||||
|
||||
std::list<RsPgpId>::iterator it;
|
||||
for(it = list.begin(); it != list.end(); it++)
|
||||
for(it = list.begin(); it != list.end(); ++it)
|
||||
{
|
||||
RsPgpId pgpId(*it);
|
||||
PGPFingerprintType fp;
|
||||
|
@ -2803,7 +2803,7 @@ bool p3IdService::recogn_handlerequest(uint32_t token)
|
|||
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsIdGroupItem* item = dynamic_cast<RsGxsIdGroupItem*>(*vit);
|
||||
if (item)
|
||||
|
@ -2879,7 +2879,7 @@ bool p3IdService::recogn_process()
|
|||
bool isPending = false;
|
||||
int i = 1;
|
||||
uint32_t tagValidFlags = 0;
|
||||
for(it = tagItems.begin(); it != tagItems.end(); it++)
|
||||
for(it = tagItems.begin(); it != tagItems.end(); ++it)
|
||||
{
|
||||
bool isTagPending = false;
|
||||
bool isTagOk = recogn_checktag(RsGxsId(item->meta.mGroupId.toStdString()), item->meta.mGroupName, *it, true, isPending);
|
||||
|
@ -3134,7 +3134,7 @@ void p3IdService::generateDummy_FriendPGP()
|
|||
|
||||
int idx = RSRandom::random_f32() * (gpgids.size() - 1);
|
||||
it = gpgids.begin();
|
||||
for(int j = 0; j < idx; j++, it++) ;
|
||||
for(int j = 0; j < idx; j++, ++it) ;
|
||||
|
||||
#if 0
|
||||
// HACK FOR DUMMY GENERATION.
|
||||
|
|
|
@ -277,7 +277,7 @@ void p3MsgService::statusChange(const std::list<pqiServicePeer> &plist)
|
|||
/* only do this when a new peer is connected */
|
||||
bool newPeers = false;
|
||||
std::list<pqiServicePeer>::const_iterator it;
|
||||
for(it = plist.begin(); it != plist.end(); it++)
|
||||
for(it = plist.begin(); it != plist.end(); ++it)
|
||||
{
|
||||
if (it->actions & RS_SERVICE_PEER_CONNECTED)
|
||||
{
|
||||
|
@ -349,7 +349,7 @@ int p3MsgService::checkOutgoingMessages()
|
|||
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
std::map<uint32_t, RsMsgItem *>::iterator mit;
|
||||
for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); mit++)
|
||||
for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); ++mit)
|
||||
{
|
||||
if (mit->second->msgFlags & RS_MSG_FLAGS_TRASH)
|
||||
continue;
|
||||
|
@ -392,7 +392,7 @@ int p3MsgService::checkOutgoingMessages()
|
|||
}
|
||||
|
||||
/* clean up */
|
||||
for(it = toErase.begin(); it != toErase.end(); it++)
|
||||
for(it = toErase.begin(); it != toErase.end(); ++it)
|
||||
{
|
||||
mit = msgOutgoing.find(*it);
|
||||
if (mit != msgOutgoing.end())
|
||||
|
@ -437,23 +437,23 @@ bool p3MsgService::saveList(bool& cleanup, std::list<RsItem*>& itemList)
|
|||
|
||||
mMsgMtx.lock();
|
||||
|
||||
for(mit = imsg.begin(); mit != imsg.end(); mit++)
|
||||
for(mit = imsg.begin(); mit != imsg.end(); ++mit)
|
||||
itemList.push_back(mit->second);
|
||||
|
||||
for(lit = mSrcIds.begin(); lit != mSrcIds.end(); lit++)
|
||||
for(lit = mSrcIds.begin(); lit != mSrcIds.end(); ++lit)
|
||||
itemList.push_back(lit->second);
|
||||
|
||||
|
||||
for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); mit++)
|
||||
for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); ++mit)
|
||||
itemList.push_back(mit->second) ;
|
||||
|
||||
for(mit2 = mTags.begin(); mit2 != mTags.end(); mit2++)
|
||||
for(mit2 = mTags.begin(); mit2 != mTags.end(); ++mit2)
|
||||
itemList.push_back(mit2->second);
|
||||
|
||||
for(mit3 = mMsgTags.begin(); mit3 != mMsgTags.end(); mit3++)
|
||||
for(mit3 = mMsgTags.begin(); mit3 != mMsgTags.end(); ++mit3)
|
||||
itemList.push_back(mit3->second);
|
||||
|
||||
for(mit4 = mParentId.begin(); mit4 != mParentId.end(); mit4++)
|
||||
for(mit4 = mParentId.begin(); mit4 != mParentId.end(); ++mit4)
|
||||
itemList.push_back(mit4->second);
|
||||
|
||||
RsConfigKeyValueSet *vitem = new RsConfigKeyValueSet ;
|
||||
|
@ -504,7 +504,7 @@ void p3MsgService::initStandardTagTypes()
|
|||
getStandardTagTypes(tags);
|
||||
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator tit;
|
||||
for (tit = tags.types.begin(); tit != tags.types.end(); tit++) {
|
||||
for (tit = tags.types.begin(); tit != tags.types.end(); ++tit) {
|
||||
std::map<uint32_t, RsMsgTagType*>::iterator mit = mTags.find(tit->first);
|
||||
if (mit == mTags.end()) {
|
||||
RsMsgTagType* tagType = new RsMsgTagType();
|
||||
|
@ -542,7 +542,7 @@ bool p3MsgService::loadList(std::list<RsItem*>& load)
|
|||
bool distant_messaging_set = false ;
|
||||
|
||||
// load items and calculate next unique msgId
|
||||
for(it = load.begin(); it != load.end(); it++)
|
||||
for(it = load.begin(); it != load.end(); ++it)
|
||||
{
|
||||
|
||||
if (NULL != (mitem = dynamic_cast<RsMsgItem *>(*it)))
|
||||
|
@ -606,7 +606,7 @@ bool p3MsgService::loadList(std::list<RsItem*>& load)
|
|||
|
||||
// sort items into lists
|
||||
std::list<RsMsgItem*>::iterator msgIt;
|
||||
for (msgIt = items.begin(); msgIt != items.end(); msgIt++)
|
||||
for (msgIt = items.begin(); msgIt != items.end(); ++msgIt)
|
||||
{
|
||||
mitem = *msgIt;
|
||||
|
||||
|
@ -644,7 +644,7 @@ bool p3MsgService::loadList(std::list<RsItem*>& load)
|
|||
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
/* remove missing msgId in mSrcIds */
|
||||
for (srcIt = srcIdMsgMap.begin(); srcIt != srcIdMsgMap.end(); srcIt++) {
|
||||
for (srcIt = srcIdMsgMap.begin(); srcIt != srcIdMsgMap.end(); ++srcIt) {
|
||||
std::map<uint32_t, RsMsgSrcId*>::iterator it = mSrcIds.find(srcIt->first);
|
||||
if (it != mSrcIds.end()) {
|
||||
delete(it->second);
|
||||
|
@ -663,7 +663,7 @@ bool p3MsgService::loadList(std::list<RsItem*>& load)
|
|||
}
|
||||
}
|
||||
|
||||
mit++;
|
||||
++mit;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -714,14 +714,14 @@ bool p3MsgService::getMessageSummaries(std::list<MsgInfoSummary> &msgList)
|
|||
RsStackMutex stack(mMsgMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
std::map<uint32_t, RsMsgItem *>::iterator mit;
|
||||
for(mit = imsg.begin(); mit != imsg.end(); mit++)
|
||||
for(mit = imsg.begin(); mit != imsg.end(); ++mit)
|
||||
{
|
||||
MsgInfoSummary mis;
|
||||
initRsMIS(mit->second, mis);
|
||||
msgList.push_back(mis);
|
||||
}
|
||||
|
||||
for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); mit++)
|
||||
for(mit = msgOutgoing.begin(); mit != msgOutgoing.end(); ++mit)
|
||||
{
|
||||
MsgInfoSummary mis;
|
||||
initRsMIS(mit->second, mis);
|
||||
|
@ -772,7 +772,7 @@ void p3MsgService::getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxN
|
|||
std::map<uint32_t, RsMsgItem *> *apMsg [2] = { &imsg, &msgOutgoing };
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
for (mit = apMsg [i]->begin(); mit != apMsg [i]->end(); mit++) {
|
||||
for (mit = apMsg [i]->begin(); mit != apMsg [i]->end(); ++mit) {
|
||||
MsgInfoSummary mis;
|
||||
initRsMIS(mit->second, mis);
|
||||
|
||||
|
@ -1034,13 +1034,13 @@ int p3MsgService::sendMessage(RsMsgItem *item)
|
|||
|
||||
bool p3MsgService::MessageSend(MessageInfo &info)
|
||||
{
|
||||
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgto.begin(); pit != info.rspeerid_msgto.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgcc.begin(); pit != info.rspeerid_msgcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgbcc.begin(); pit != info.rspeerid_msgbcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgto.begin(); pit != info.rspeerid_msgto.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgcc.begin(); pit != info.rspeerid_msgcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsPeerId>::const_iterator pit = info.rspeerid_msgbcc.begin(); pit != info.rspeerid_msgbcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
|
||||
|
||||
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgto.begin(); pit != info.rsgxsid_msgto.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgcc.begin(); pit != info.rsgxsid_msgcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgbcc.begin(); pit != info.rsgxsid_msgbcc.end(); pit++) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgto.begin(); pit != info.rsgxsid_msgto.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgcc.begin(); pit != info.rsgxsid_msgcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
|
||||
for(std::list<RsGxsId>::const_iterator pit = info.rsgxsid_msgbcc.begin(); pit != info.rsgxsid_msgbcc.end(); ++pit) sendMessage(initMIRsMsg(info, *pit));
|
||||
|
||||
/* send to ourselves as well */
|
||||
RsMsgItem *msg = initMIRsMsg(info, mServiceCtrl->getOwnId());
|
||||
|
@ -1155,7 +1155,7 @@ bool p3MsgService::getMessageTagTypes(MsgTagType& tags)
|
|||
|
||||
std::map<uint32_t, RsMsgTagType*>::iterator mit;
|
||||
|
||||
for(mit = mTags.begin(); mit != mTags.end(); mit++) {
|
||||
for(mit = mTags.begin(); mit != mTags.end(); ++mit) {
|
||||
std::pair<std::string, uint32_t> p(mit->second->text, mit->second->rgb_color);
|
||||
tags.types.insert(std::pair<uint32_t, std::pair<std::string, uint32_t> >(mit->first, p));
|
||||
}
|
||||
|
@ -1256,7 +1256,7 @@ bool p3MsgService::removeMessageTagType(uint32_t tagId)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
mit1++;
|
||||
++mit1;
|
||||
}
|
||||
|
||||
/* remove tag type */
|
||||
|
@ -1389,7 +1389,7 @@ bool p3MsgService::resetMessageStandardTagTypes(MsgTagType& tags)
|
|||
getStandardTagTypes(standardTags);
|
||||
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator mit;
|
||||
for (mit = standardTags.types.begin(); mit != standardTags.types.end(); mit++) {
|
||||
for (mit = standardTags.types.begin(); mit != standardTags.types.end(); ++mit) {
|
||||
tags.types[mit->first] = mit->second;
|
||||
}
|
||||
|
||||
|
@ -1504,7 +1504,7 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi)
|
|||
mi.count = 0;
|
||||
mi.size = 0;
|
||||
|
||||
for(std::list<RsTlvFileItem>::iterator it = msg->attachment.items.begin(); it != msg->attachment.items.end(); it++)
|
||||
for(std::list<RsTlvFileItem>::iterator it = msg->attachment.items.begin(); it != msg->attachment.items.end(); ++it)
|
||||
{
|
||||
FileInfo fi;
|
||||
fi.fname = RsDirUtil::getTopDir(it->name);
|
||||
|
@ -1622,7 +1622,7 @@ void p3MsgService::initMIRsMsg(RsMsgItem *msg,const MessageInfo& info)
|
|||
msg -> attachment.title = info.attach_title;
|
||||
msg -> attachment.comment = info.attach_comment;
|
||||
|
||||
for(std::list<FileInfo>::const_iterator it = info.files.begin(); it != info.files.end(); it++)
|
||||
for(std::list<FileInfo>::const_iterator it = info.files.begin(); it != info.files.end(); ++it)
|
||||
{
|
||||
RsTlvFileItem mfi;
|
||||
mfi.hash = it -> hash;
|
||||
|
|
|
@ -153,7 +153,7 @@ void p3PhotoService::groupsChanged(std::list<RsGxsGroupId>& grpIds)
|
|||
RsGxsGroupChange* gc = mGroupChange.back();
|
||||
std::list<RsGxsGroupId>& gList = gc->mGrpIdList;
|
||||
std::list<RsGxsGroupId>::iterator lit = gList.begin();
|
||||
for(; lit != gList.end(); lit++)
|
||||
for(; lit != gList.end(); ++lit)
|
||||
grpIds.push_back(*lit);
|
||||
|
||||
mGroupChange.pop_back();
|
||||
|
@ -221,7 +221,7 @@ bool p3PhotoService::getAlbum(const uint32_t& token, std::vector<RsPhotoAlbum>&
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsPhotoAlbumItem* item = dynamic_cast<RsGxsPhotoAlbumItem*>(*vit);
|
||||
if (item)
|
||||
|
@ -252,13 +252,13 @@ bool p3PhotoService::getPhoto(const uint32_t& token, PhotoResult& photos)
|
|||
{
|
||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
RsGxsGroupId grpId = mit->first;
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsPhotoPhotoItem* item = dynamic_cast<RsGxsPhotoPhotoItem*>(*vit);
|
||||
|
||||
|
@ -289,13 +289,13 @@ bool p3PhotoService::getPhotoComment(const uint32_t &token, PhotoCommentResult &
|
|||
{
|
||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
RsGxsGroupId grpId = mit->first;
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsPhotoCommentItem* item = dynamic_cast<RsGxsPhotoCommentItem*>(*vit);
|
||||
|
||||
|
@ -348,7 +348,7 @@ void p3PhotoService::notifyChanges(std::vector<RsGxsNotify*>& changes)
|
|||
|
||||
std::vector<RsGxsNotify*>::iterator vit = changes.begin();
|
||||
|
||||
for(; vit != changes.end(); vit++)
|
||||
for(; vit != changes.end(); ++vit)
|
||||
{
|
||||
RsGxsNotify* n = *vit;
|
||||
RsGxsGroupChange* gc;
|
||||
|
|
|
@ -88,7 +88,7 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
|
||||
std::vector<RsGxsNotify *>::iterator it;
|
||||
|
||||
for(it = changes.begin(); it != changes.end(); it++)
|
||||
for(it = changes.begin(); it != changes.end(); ++it)
|
||||
{
|
||||
RsGxsGroupChange *groupChange = dynamic_cast<RsGxsGroupChange *>(*it);
|
||||
RsGxsMsgChange *msgChange = dynamic_cast<RsGxsMsgChange *>(*it);
|
||||
|
@ -99,7 +99,7 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgChangeMap = msgChange->msgChangeMap;
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::iterator mit;
|
||||
for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); mit++)
|
||||
for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); ++mit)
|
||||
{
|
||||
std::cerr << "p3PostBase::notifyChanges() Msgs for Group: " << mit->first;
|
||||
std::cerr << std::endl;
|
||||
|
@ -118,7 +118,7 @@ void p3PostBase::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
|
||||
std::list<RsGxsGroupId> &groupList = groupChange->mGrpIdList;
|
||||
std::list<RsGxsGroupId>::iterator git;
|
||||
for(git = groupList.begin(); git != groupList.end(); git++)
|
||||
for(git = groupList.begin(); git != groupList.end(); ++git)
|
||||
{
|
||||
std::cerr << "p3PostBase::notifyChanges() Incoming Group: " << *git;
|
||||
std::cerr << std::endl;
|
||||
|
@ -243,7 +243,7 @@ void p3PostBase::background_loadGroups(const uint32_t &token)
|
|||
}
|
||||
|
||||
std::list<RsGxsGroupId>::iterator it;
|
||||
for(it = groupList.begin(); it != groupList.end(); it++)
|
||||
for(it = groupList.begin(); it != groupList.end(); ++it)
|
||||
{
|
||||
addGroupForProcessing(*it);
|
||||
}
|
||||
|
@ -390,10 +390,10 @@ void p3PostBase::background_loadMsgs(const uint32_t &token, bool unprocessed)
|
|||
RsGxsGroupId groupId;
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMsgItem*> >::iterator mit;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit;
|
||||
for (mit = msgData.begin(); mit != msgData.end(); mit++)
|
||||
for (mit = msgData.begin(); mit != msgData.end(); ++mit)
|
||||
{
|
||||
groupId = mit->first;
|
||||
for (vit = mit->second.begin(); vit != mit->second.end(); vit++)
|
||||
for (vit = mit->second.begin(); vit != mit->second.end(); ++vit)
|
||||
{
|
||||
RsGxsMessageId parentId = (*vit)->meta.mParentId;
|
||||
RsGxsMessageId threadId = (*vit)->meta.mThreadId;
|
||||
|
@ -596,9 +596,9 @@ void p3PostBase::background_updateVoteCounts(const uint32_t &token)
|
|||
std::vector<RsGxsNotify *> changes;
|
||||
RsGxsMsgChange *msgChanges = new RsGxsMsgChange(RsGxsNotify::TYPE_PROCESSED, false);
|
||||
|
||||
for(mit = parentMsgList.begin(); mit != parentMsgList.end(); mit++)
|
||||
for(mit = parentMsgList.begin(); mit != parentMsgList.end(); ++mit)
|
||||
{
|
||||
for(vit = mit->second.begin(); vit != mit->second.end(); vit++)
|
||||
for(vit = mit->second.begin(); vit != mit->second.end(); ++vit)
|
||||
{
|
||||
std::cerr << "p3PostBase::background_updateVoteCounts() Processing Msg(" << mit->first;
|
||||
std::cerr << ", " << vit->mMsgId << ")";
|
||||
|
|
|
@ -77,7 +77,7 @@ bool p3Posted::getGroupData(const uint32_t &token, std::vector<RsPostedGroup> &g
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsPostedGroupItem* item = dynamic_cast<RsGxsPostedGroupItem*>(*vit);
|
||||
if (item)
|
||||
|
@ -108,13 +108,13 @@ bool p3Posted::getPostData(const uint32_t &token, std::vector<RsPostedPost> &msg
|
|||
{
|
||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
RsGxsGroupId grpId = mit->first;
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsPostedPostItem* item = dynamic_cast<RsGxsPostedPostItem*>(*vit);
|
||||
|
||||
|
@ -150,12 +150,12 @@ bool p3Posted::getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost>
|
|||
{
|
||||
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsPostedPostItem* item = dynamic_cast<RsGxsPostedPostItem*>(*vit);
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ void p3rtt::sendPingMeasurements()
|
|||
|
||||
/* prepare packets */
|
||||
std::set<RsPeerId>::iterator it;
|
||||
for(it = idList.begin(); it != idList.end(); it++)
|
||||
for(it = idList.begin(); it != idList.end(); ++it)
|
||||
{
|
||||
#ifdef DEBUG_RTT
|
||||
std::cerr << "p3rtt::sendPingMeasurements() Pinging: " << *it;
|
||||
|
@ -389,7 +389,7 @@ uint32_t p3rtt::getPongResults(const RsPeerId& id, int n, std::list<RsRttPongRes
|
|||
|
||||
std::list<RsRttPongResult>::reverse_iterator it;
|
||||
int i = 0;
|
||||
for(it = peer->mPongResults.rbegin(); (it != peer->mPongResults.rend()) && (i < n); it++, i++)
|
||||
for(it = peer->mPongResults.rbegin(); (it != peer->mPongResults.rend()) && (i < n); ++it, i++)
|
||||
{
|
||||
/* reversing order - so its easy to trim later */
|
||||
results.push_back(*it);
|
||||
|
|
|
@ -184,7 +184,7 @@ bool p3ServiceInfo::sendPackets()
|
|||
|
||||
RsStackMutex stack(mInfoMtx); /****** LOCKED MUTEX *******/
|
||||
std::set<RsPeerId>::iterator it;
|
||||
for(it = updateSet.begin(); it != updateSet.end(); it++)
|
||||
for(it = updateSet.begin(); it != updateSet.end(); ++it)
|
||||
{
|
||||
sendServiceInfoList(*it);
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ void p3ServiceInfo::statusChange(const std::list<pqipeer> &plist)
|
|||
std::cerr << std::endl;
|
||||
|
||||
std::list<pqipeer>::const_iterator it;
|
||||
for (it = plist.begin(); it != plist.end(); it++)
|
||||
for (it = plist.begin(); it != plist.end(); ++it)
|
||||
{
|
||||
if (it->state & RS_PEER_S_FRIEND)
|
||||
{
|
||||
|
|
|
@ -119,7 +119,7 @@ bool p3StatusService::getStatusList(std::list<StatusInfo>& statusInfo)
|
|||
|
||||
// fill up statusInfo list with this information
|
||||
std::map<RsPeerId, StatusInfo>::iterator mit;
|
||||
for(mit = mStatusInfoMap.begin(); mit != mStatusInfoMap.end(); mit++){
|
||||
for(mit = mStatusInfoMap.begin(); mit != mStatusInfoMap.end(); ++mit){
|
||||
statusInfo.push_back(mit->second);
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ bool p3StatusService::sendStatus(const RsPeerId &id, uint32_t status)
|
|||
#endif
|
||||
|
||||
// send to all peers online
|
||||
for(it = onlineList.begin(); it != onlineList.end(); it++){
|
||||
for(it = onlineList.begin(); it != onlineList.end(); ++it){
|
||||
RsStatusItem* statusItem = new RsStatusItem();
|
||||
statusItem->sendTime = time(NULL);
|
||||
statusItem->status = statusInfo.status;
|
||||
|
@ -260,7 +260,7 @@ void p3StatusService::receiveStatusQueue()
|
|||
|
||||
if (changed.size()) {
|
||||
std::map<RsPeerId, uint32_t>::iterator it;
|
||||
for (it = changed.begin(); it != changed.end(); it++) {
|
||||
for (it = changed.begin(); it != changed.end(); ++it) {
|
||||
RsServer::notify()->notifyPeerStatusChanged(it->first.toStdString(), it->second);
|
||||
}
|
||||
RsServer::notify()->notifyPeerStatusChangedSummary();
|
||||
|
@ -320,7 +320,7 @@ bool p3StatusService::loadList(std::list<RsItem*>& load){
|
|||
return false;
|
||||
}
|
||||
|
||||
for(; it != load.end(); it++){
|
||||
for(; it != load.end(); ++it){
|
||||
RsStatusItem* own_status = dynamic_cast<RsStatusItem* >(*it);
|
||||
|
||||
|
||||
|
@ -369,7 +369,7 @@ void p3StatusService::statusChange(const std::list<pqiServicePeer> &plist)
|
|||
|
||||
StatusInfo statusInfo;
|
||||
std::list<pqiServicePeer>::const_iterator it;
|
||||
for (it = plist.begin(); it != plist.end(); it++)
|
||||
for (it = plist.begin(); it != plist.end(); ++it)
|
||||
{
|
||||
if (it->actions & RS_SERVICE_PEER_DISCONNECTED)
|
||||
{
|
||||
|
|
|
@ -123,7 +123,7 @@ bool p3Wiki::getCollections(const uint32_t &token, std::vector<RsWikiCollection>
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsWikiCollectionItem* item = dynamic_cast<RsGxsWikiCollectionItem*>(*vit);
|
||||
|
||||
|
@ -160,13 +160,13 @@ bool p3Wiki::getSnapshots(const uint32_t &token, std::vector<RsWikiSnapshot> &sn
|
|||
{
|
||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
RsGxsGroupId grpId = mit->first;
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsWikiSnapshotItem* item = dynamic_cast<RsGxsWikiSnapshotItem*>(*vit);
|
||||
|
||||
|
@ -199,12 +199,12 @@ bool p3Wiki::getRelatedSnapshots(const uint32_t &token, std::vector<RsWikiSnapsh
|
|||
{
|
||||
GxsMsgRelatedDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsWikiSnapshotItem* item = dynamic_cast<RsGxsWikiSnapshotItem*>(*vit);
|
||||
|
||||
|
@ -237,7 +237,7 @@ bool p3Wiki::getComments(const uint32_t &token, std::vector<RsWikiComment> &comm
|
|||
{
|
||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
RsGxsGroupId grpId = mit->first;
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
|
@ -522,7 +522,7 @@ RsGxsId chooseRandomAuthorId()
|
|||
|
||||
uint32_t idx = (uint32_t) (RSRandom::random_u32() % (int)ownIds.size()) ;
|
||||
int i = 0;
|
||||
for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); it++, i++) ;
|
||||
for(it = ownIds.begin(); (it != ownIds.end()) && (i < idx); ++it, i++) ;
|
||||
|
||||
return *it ;
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ bool p3Wire::getGroupData(const uint32_t &token, std::vector<RsWireGroup> &group
|
|||
{
|
||||
std::vector<RsGxsGrpItem*>::iterator vit = grpData.begin();
|
||||
|
||||
for(; vit != grpData.end(); vit++)
|
||||
for(; vit != grpData.end(); ++vit)
|
||||
{
|
||||
RsGxsWireGroupItem* item = dynamic_cast<RsGxsWireGroupItem*>(*vit);
|
||||
|
||||
|
@ -146,13 +146,13 @@ bool p3Wire::getPulseData(const uint32_t &token, std::vector<RsWirePulse> &pulse
|
|||
{
|
||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); mit++)
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
{
|
||||
RsGxsGroupId grpId = mit->first;
|
||||
std::vector<RsGxsMsgItem*>& msgItems = mit->second;
|
||||
std::vector<RsGxsMsgItem*>::iterator vit = msgItems.begin();
|
||||
|
||||
for(; vit != msgItems.end(); vit++)
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsWirePulseItem* item = dynamic_cast<RsGxsWirePulseItem*>(*vit);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue