Added new method cancelActiveRequestTokens to TokenQueue.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6492 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2013-07-09 11:57:57 +00:00
parent 6ee0aa9b3f
commit 249f2ff2e0
2 changed files with 15 additions and 2 deletions

View File

@ -209,6 +209,18 @@ void TokenQueue::activeRequestTokens(const uint32_t& userType, std::list<uint32_
}
void TokenQueue::cancelActiveRequestTokens(const uint32_t& userType)
{
std::list<uint32_t> tokens;
activeRequestTokens(userType, tokens);
if (!tokens.empty()) {
std::list<uint32_t>::iterator tokenIt;
for (tokenIt = tokens.begin(); tokenIt != tokens.end(); ++tokenIt) {
cancelRequest(*tokenIt);
}
}
}
void TokenQueue::loadRequest(const TokenRequest &req)
{
std::cerr << "TokenQueue::loadRequest(): ";

View File

@ -101,6 +101,7 @@ public:
bool activeRequestExist(const uint32_t& userType) const;
void activeRequestTokens(const uint32_t& userType, std::list<uint32_t>& tokens) const;
void cancelActiveRequestTokens(const uint32_t& userType);
protected:
void doPoll(float dt);