mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-10 03:49:51 -05:00
add json support to getWaitingDiscCount
This commit is contained in:
parent
be50400114
commit
ae14a01d58
@ -71,6 +71,15 @@ class RsDisc
|
|||||||
*/
|
*/
|
||||||
virtual bool getPeerVersion(const RsPeerId &id, std::string &versions) = 0;
|
virtual bool getPeerVersion(const RsPeerId &id, std::string &versions) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief getWaitingDiscCount get the number of queued discovery packets.
|
||||||
|
* @jsonapi{development}
|
||||||
|
* @param[out] sendCount number of queued outgoing packets
|
||||||
|
* @param[out] recvCount number of queued incoming packets
|
||||||
|
* @return true on success false otherwise
|
||||||
|
*/
|
||||||
|
virtual bool getWaitingDiscCount(size_t &sendCount, size_t &recvCount) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief getWaitingDiscCount get the number of queued discovery packets.
|
* @brief getWaitingDiscCount get the number of queued discovery packets.
|
||||||
* @param[out] sendCount number of queued outgoing packets
|
* @param[out] sendCount number of queued outgoing packets
|
||||||
|
@ -1177,6 +1177,15 @@ bool p3discovery2::getDiscFriends(const RsPeerId& id, std::list<RsPeerId> &proxy
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool p3discovery2::getWaitingDiscCount(size_t &sendCount, size_t &recvCount)
|
||||||
|
{
|
||||||
|
RsStackMutex stack(mDiscMtx); /********** STACK LOCKED MTX ******/
|
||||||
|
sendCount = mPendingDiscPgpCertOutList.size();
|
||||||
|
recvCount = mPendingDiscPgpCertInList.size();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool p3discovery2::getDiscPgpFriends(const PGPID &pgp_id, std::list<PGPID> &proxyPgpIds)
|
bool p3discovery2::getDiscPgpFriends(const PGPID &pgp_id, std::list<PGPID> &proxyPgpIds)
|
||||||
{
|
{
|
||||||
@ -1245,14 +1254,15 @@ bool p3discovery2::getWaitingDiscCount(unsigned int *sendCount, unsigned int *re
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RsStackMutex stack(mDiscMtx); /********** STACK LOCKED MTX ******/
|
size_t send, recv;
|
||||||
|
getWaitingDiscCount(send, recv);
|
||||||
|
|
||||||
if (sendCount) {
|
if (sendCount) {
|
||||||
*sendCount = mPendingDiscPgpCertOutList.size();
|
*sendCount = send;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recvCount) {
|
if (recvCount) {
|
||||||
*recvCount = mPendingDiscPgpCertInList.size();
|
*recvCount = recv;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -87,10 +87,11 @@ virtual RsServiceInfo getServiceInfo();
|
|||||||
int tick();
|
int tick();
|
||||||
|
|
||||||
/* external interface */
|
/* external interface */
|
||||||
virtual bool getDiscFriends(const RsPeerId &id, std::list<RsPeerId> &friends);
|
bool getDiscFriends(const RsPeerId &id, std::list<RsPeerId> &friends);
|
||||||
virtual bool getDiscPgpFriends(const RsPgpId &pgpid, std::list<RsPgpId> &gpg_friends);
|
bool getDiscPgpFriends(const RsPgpId &pgpid, std::list<RsPgpId> &gpg_friends);
|
||||||
virtual bool getPeerVersion(const RsPeerId &id, std::string &version);
|
bool getPeerVersion(const RsPeerId &id, std::string &version);
|
||||||
virtual bool getWaitingDiscCount(unsigned int *sendCount, unsigned int *recvCount);
|
bool getWaitingDiscCount(size_t &sendCount, size_t &recvCount);
|
||||||
|
bool getWaitingDiscCount(unsigned int *sendCount, unsigned int *recvCount);
|
||||||
|
|
||||||
/************* from AuthGPService ****************/
|
/************* from AuthGPService ****************/
|
||||||
virtual AuthGPGOperation *getGPGOperation();
|
virtual AuthGPGOperation *getGPGOperation();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user