mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-23 14:39:34 -05:00
don't send gpg key when all the ssl childs are on no disc or when we got no ssl child of it
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2084 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b4d89ccd94
commit
abf19c964a
@ -153,7 +153,7 @@ std::ostream &RsDiscAskInfo::print(std::ostream &out, uint16_t indent)
|
|||||||
printIndent(out, int_Indent);
|
printIndent(out, int_Indent);
|
||||||
out << "gpg_id: " << gpg_id << std::endl;
|
out << "gpg_id: " << gpg_id << std::endl;
|
||||||
|
|
||||||
printRsItemEnd(out, "RsDiscOwnItem", indent);
|
printRsItemEnd(out, "RsDiscAskInfo", indent);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,16 +312,17 @@ void p3disc::sendPeerDetails(std::string to, std::string about) {
|
|||||||
// Set Target as input cert.
|
// Set Target as input cert.
|
||||||
di -> PeerId(to);
|
di -> PeerId(to);
|
||||||
di -> aboutId = about;
|
di -> aboutId = about;
|
||||||
di -> certGPG = AuthGPG::getAuthGPG()->SaveCertificateToString(about);
|
|
||||||
|
|
||||||
// set the ip addresse list.
|
// set the ip addresse list.
|
||||||
std::list<std::string> sslChilds;
|
std::list<std::string> sslChilds;
|
||||||
rsPeers->getSSLChildListOfGPGId(about, sslChilds);
|
rsPeers->getSSLChildListOfGPGId(about, sslChilds);
|
||||||
|
bool shouldWeSendGPGKey = false;//the GPG key is send only if we've got a valid friend with DISC enabled
|
||||||
for (std::list<std::string>::iterator sslChildIt = sslChilds.begin(); sslChildIt != sslChilds.end(); sslChildIt++) {
|
for (std::list<std::string>::iterator sslChildIt = sslChilds.begin(); sslChildIt != sslChilds.end(); sslChildIt++) {
|
||||||
peerConnectState detail;
|
peerConnectState detail;
|
||||||
if (!mConnMgr->getFriendNetStatus(*sslChildIt, detail) || detail.visState & RS_VIS_STATE_NODISC) {
|
if (!mConnMgr->getFriendNetStatus(*sslChildIt, detail) || detail.visState & RS_VIS_STATE_NODISC) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
shouldWeSendGPGKey = true;
|
||||||
RsPeerNetItem *rsPeerNetItem = new RsPeerNetItem();
|
RsPeerNetItem *rsPeerNetItem = new RsPeerNetItem();
|
||||||
rsPeerNetItem->clear();
|
rsPeerNetItem->clear();
|
||||||
|
|
||||||
@ -343,6 +344,7 @@ void p3disc::sendPeerDetails(std::string to, std::string about) {
|
|||||||
if (about == rsPeers->getGPGOwnId()) {
|
if (about == rsPeers->getGPGOwnId()) {
|
||||||
peerConnectState detail;
|
peerConnectState detail;
|
||||||
if (mConnMgr->getOwnNetStatus(detail)) {
|
if (mConnMgr->getOwnNetStatus(detail)) {
|
||||||
|
shouldWeSendGPGKey = true;
|
||||||
RsPeerNetItem *rsPeerNetItem = new RsPeerNetItem();
|
RsPeerNetItem *rsPeerNetItem = new RsPeerNetItem();
|
||||||
rsPeerNetItem->clear();
|
rsPeerNetItem->clear();
|
||||||
rsPeerNetItem->pid = detail.id;
|
rsPeerNetItem->pid = detail.id;
|
||||||
@ -359,6 +361,14 @@ void p3disc::sendPeerDetails(std::string to, std::string about) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!shouldWeSendGPGKey) {
|
||||||
|
#ifdef P3DISC_DEBUG
|
||||||
|
std::cerr << "p3disc::sendPeerDetails() GPG key should not be send, no friend with disc on found about it." << std::endl;
|
||||||
|
#endif
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
di -> certGPG = AuthGPG::getAuthGPG()->SaveCertificateToString(about);
|
||||||
|
|
||||||
// Send off message
|
// Send off message
|
||||||
#ifdef P3DISC_DEBUG
|
#ifdef P3DISC_DEBUG
|
||||||
di->print(std::cerr, 5);
|
di->print(std::cerr, 5);
|
||||||
|
Loading…
Reference in New Issue
Block a user