Merge pull request #1829 from G10h4ck/rsfiles_links

RsFiles links support in libretroshare + a bunch of fixes
This commit is contained in:
G10h4ck 2020-04-20 17:12:04 +02:00 committed by GitHub
commit 2b44492cb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 2949 additions and 1667 deletions

View file

@ -75,8 +75,8 @@ void RsDiscPgpKeyItem::clear()
{
pgpKeyId.clear();
free(bin_data);
bin_data = nullptr;
bin_len=0;
bin_data = nullptr;
bin_len = 0;
}
void RsDiscContactItem::clear()

View file

@ -84,17 +84,23 @@ class RsDiscPgpKeyItem: public RsDiscItem
{
public:
RsDiscPgpKeyItem() : RsDiscItem(RsGossipDiscoveryItemType::PGP_CERT_BINARY)
RsDiscPgpKeyItem() :
RsDiscItem(RsGossipDiscoveryItemType::PGP_CERT_BINARY),
bin_data(nullptr), bin_len(0)
{ setPriorityLevel(QOS_PRIORITY_RS_DISC_PGP_CERT); }
virtual ~RsDiscPgpKeyItem() { delete[](bin_data);bin_data=nullptr;bin_len=0;}
~RsDiscPgpKeyItem() override { free(bin_data); }
void clear() override;
void serial_process( RsGenericSerializer::SerializeJob j, RsGenericSerializer::SerializeContext& ctx) override;
RsPgpId pgpKeyId; // duplicate information for practical reasons
unsigned char *bin_data; // binry key data allocated with new unsigned char[]
uint32_t bin_len;
void serial_process(
RsGenericSerializer::SerializeJob j,
RsGenericSerializer::SerializeContext& ctx ) override;
/// duplicate information for practical reasons
RsPgpId pgpKeyId;
unsigned char* bin_data;
uint32_t bin_len;
};
class RS_DEPRECATED_FOR(RsDiscPgpKeyItem) RsDiscPgpCertItem: public RsDiscItem

View file

@ -108,14 +108,6 @@ p3discovery2::p3discovery2(
// Add self into PGP FriendList.
mFriendList[AuthGPG::getAuthGPG()->getGPGOwnId()] = DiscPgpInfo();
if(rsEvents)
rsEvents->registerEventsHandler(
RsEventType::GOSSIP_DISCOVERY,
[this](std::shared_ptr<const RsEvent> event)
{
rsEventsHandler(*event);
}, mRsEventsHandle ); // mRsEventsHandle is zeroed in initializer list
}
@ -1284,11 +1276,6 @@ bool p3discovery2::setPeerVersion(const RsPeerId &peerId, const std::string &ver
return true;
}
void p3discovery2::rsEventsHandler(const RsEvent& event)
{
Dbg3() << __PRETTY_FUNCTION__ << " " << static_cast<uint32_t>(event.mType) << std::endl;
}
/*************************************************************************************/
/* AuthGPGService */