mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-21 21:59:02 -04:00
fixed up tlv serialisers:
- Added RsTvlUnit: public RsTlvItem, which handles some of the infrstructure. - made TlvSize() SetTlv() and print() const. - split rstlvtypes into its bits and cleaned up header files. - added templated RsTlvList, imilar to cyrils id one. - removed GXS_GEN_TESTNET - cleanedup rsserviceids. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7215 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
1042744685
commit
600639db51
86 changed files with 2464 additions and 2444 deletions
|
@ -151,7 +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.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,
|
||||
|
@ -450,7 +451,8 @@ int p3BanList::sendBanSet(const RsPeerId& peerid)
|
|||
bi.level = it->second.level;
|
||||
bi.age = now - it->second.mTs;
|
||||
|
||||
item->peerList.entries.push_back(bi);
|
||||
//item->peerList.entries.push_back(bi);
|
||||
item->peerList.mList.push_back(bi);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -273,9 +273,11 @@ int p3Dsdv::generateRoutingTable(const RsPeerId &peerId, bool incremental)
|
|||
entry.sequence = v.mStableRoute.mSequence;
|
||||
entry.distance = v.mStableRoute.mDistance;
|
||||
|
||||
dsdv->routes.entries.push_back(entry);
|
||||
//dsdv->routes.entries.push_back(entry);
|
||||
dsdv->routes.mList.push_back(entry);
|
||||
|
||||
if (dsdv->routes.entries.size() > RSDSDV_MAX_ROUTE_TABLE)
|
||||
//if (dsdv->routes.entries.size() > RSDSDV_MAX_ROUTE_TABLE)
|
||||
if (dsdv->routes.mList.size() > RSDSDV_MAX_ROUTE_TABLE)
|
||||
{
|
||||
sendItem(dsdv);
|
||||
dsdv = new RsDsdvRouteItem();
|
||||
|
@ -329,7 +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.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;
|
||||
|
|
|
@ -65,11 +65,11 @@ RsGxsChannels *rsGxsChannels = NULL;
|
|||
/********************************************************************************/
|
||||
|
||||
p3GxsChannels::p3GxsChannels(RsGeneralDataService *gds, RsNetworkExchangeService *nes, RsGixs* gixs)
|
||||
: RsGenExchange(gds, nes, new RsGxsChannelSerialiser(), RS_SERVICE_GXSV2_TYPE_CHANNELS, gixs, channelsAuthenPolicy()), RsGxsChannels(this), GxsTokenQueue(this)
|
||||
: RsGenExchange(gds, nes, new RsGxsChannelSerialiser(), RS_SERVICE_GXS_TYPE_CHANNELS, gixs, channelsAuthenPolicy()), RsGxsChannels(this), GxsTokenQueue(this)
|
||||
{
|
||||
// For Dummy Msgs.
|
||||
mGenActive = false;
|
||||
mCommentService = new p3GxsCommentService(this, RS_SERVICE_GXSV2_TYPE_CHANNELS);
|
||||
mCommentService = new p3GxsCommentService(this, RS_SERVICE_GXS_TYPE_CHANNELS);
|
||||
|
||||
RsTickEvent::schedule_in(CHANNEL_PROCESS, 0);
|
||||
|
||||
|
@ -87,7 +87,7 @@ const uint16_t GXS_CHANNELS_MIN_MINOR_VERSION = 0;
|
|||
|
||||
RsServiceInfo p3GxsChannels::getServiceInfo()
|
||||
{
|
||||
return RsServiceInfo(RS_SERVICE_GXSV2_TYPE_CHANNELS,
|
||||
return RsServiceInfo(RS_SERVICE_GXS_TYPE_CHANNELS,
|
||||
GXS_CHANNELS_APP_NAME,
|
||||
GXS_CHANNELS_APP_MAJOR_VERSION,
|
||||
GXS_CHANNELS_APP_MINOR_VERSION,
|
||||
|
|
|
@ -108,7 +108,7 @@ RsGxsCircles *rsGxsCircles = NULL;
|
|||
|
||||
p3GxsCircles::p3GxsCircles(RsGeneralDataService *gds, RsNetworkExchangeService *nes, p3IdService *identities)
|
||||
: RsGxsCircleExchange(gds, nes, new RsGxsCircleSerialiser(),
|
||||
RS_SERVICE_GXSV2_TYPE_GXSCIRCLE, identities, circleAuthenPolicy()),
|
||||
RS_SERVICE_GXS_TYPE_GXSCIRCLE, identities, circleAuthenPolicy()),
|
||||
RsGxsCircles(this), GxsTokenQueue(this), RsTickEvent(), mIdentities(identities),
|
||||
mCircleMtx("p3GxsCircles"),
|
||||
mCircleCache(DEFAULT_MEM_CACHE_SIZE, "GxsCircleCache")
|
||||
|
@ -120,12 +120,7 @@ p3GxsCircles::p3GxsCircles(RsGeneralDataService *gds, RsNetworkExchangeService *
|
|||
RsTickEvent::schedule_now(CIRCLE_EVENT_LOADIDS);
|
||||
|
||||
// Dummy Circles.
|
||||
|
||||
#ifndef GXS_DEV_TESTNET // NO RESET, OR DUMMYDATA for TESTNET
|
||||
|
||||
RsTickEvent::schedule_in(CIRCLE_EVENT_DUMMYSTART, CIRCLE_DUMMY_STARTPERIOD);
|
||||
|
||||
#endif
|
||||
// RsTickEvent::schedule_in(CIRCLE_EVENT_DUMMYSTART, CIRCLE_DUMMY_STARTPERIOD);
|
||||
|
||||
}
|
||||
|
||||
|
@ -138,7 +133,7 @@ const uint16_t GXS_CIRCLES_MIN_MINOR_VERSION = 0;
|
|||
|
||||
RsServiceInfo p3GxsCircles::getServiceInfo()
|
||||
{
|
||||
return RsServiceInfo(RS_SERVICE_GXSV2_TYPE_GXSCIRCLE,
|
||||
return RsServiceInfo(RS_SERVICE_GXS_TYPE_GXSCIRCLE,
|
||||
GXS_CIRCLES_APP_NAME,
|
||||
GXS_CIRCLES_APP_MAJOR_VERSION,
|
||||
GXS_CIRCLES_APP_MINOR_VERSION,
|
||||
|
|
|
@ -51,7 +51,7 @@ RsGxsForums *rsGxsForums = NULL;
|
|||
/********************************************************************************/
|
||||
|
||||
p3GxsForums::p3GxsForums(RsGeneralDataService *gds, RsNetworkExchangeService *nes, RsGixs* gixs)
|
||||
: RsGenExchange(gds, nes, new RsGxsForumSerialiser(), RS_SERVICE_GXSV2_TYPE_FORUMS, gixs, forumsAuthenPolicy()), RsGxsForums(this)
|
||||
: RsGenExchange(gds, nes, new RsGxsForumSerialiser(), RS_SERVICE_GXS_TYPE_FORUMS, gixs, forumsAuthenPolicy()), RsGxsForums(this)
|
||||
{
|
||||
// For Dummy Msgs.
|
||||
mGenActive = false;
|
||||
|
@ -70,7 +70,7 @@ const uint16_t GXS_FORUMS_MIN_MINOR_VERSION = 0;
|
|||
|
||||
RsServiceInfo p3GxsForums::getServiceInfo()
|
||||
{
|
||||
return RsServiceInfo(RS_SERVICE_GXSV2_TYPE_FORUMS,
|
||||
return RsServiceInfo(RS_SERVICE_GXS_TYPE_FORUMS,
|
||||
GXS_FORUMS_APP_NAME,
|
||||
GXS_FORUMS_APP_MAJOR_VERSION,
|
||||
GXS_FORUMS_APP_MINOR_VERSION,
|
||||
|
|
|
@ -142,7 +142,7 @@ const uint16_t GXS_REPUTATION_MIN_MINOR_VERSION = 0;
|
|||
|
||||
RsServiceInfo p3GxsReputation::getServiceInfo()
|
||||
{
|
||||
return RsServiceInfo(RS_SERVICE_GXSV2_TYPE_REPUTATION,
|
||||
return RsServiceInfo(RS_SERVICE_GXS_TYPE_REPUTATION,
|
||||
GXS_REPUTATION_APP_NAME,
|
||||
GXS_REPUTATION_APP_MAJOR_VERSION,
|
||||
GXS_REPUTATION_APP_MINOR_VERSION,
|
||||
|
|
|
@ -139,7 +139,7 @@ RsIdentity *rsIdentity = NULL;
|
|||
/********************************************************************************/
|
||||
|
||||
p3IdService::p3IdService(RsGeneralDataService *gds, RsNetworkExchangeService *nes)
|
||||
: RsGxsIdExchange(gds, nes, new RsGxsIdSerialiser(), RS_SERVICE_GXSV2_TYPE_GXSID, idAuthenPolicy()),
|
||||
: RsGxsIdExchange(gds, nes, new RsGxsIdSerialiser(), RS_SERVICE_GXS_TYPE_GXSID, idAuthenPolicy()),
|
||||
RsIdentity(this), GxsTokenQueue(this), RsTickEvent(),
|
||||
mPublicKeyCache(DEFAULT_MEM_CACHE_SIZE, "GxsIdPublicKeyCache"),
|
||||
mPrivateKeyCache(DEFAULT_MEM_CACHE_SIZE, "GxsIdPrivateKeyCache"),
|
||||
|
@ -153,13 +153,10 @@ p3IdService::p3IdService(RsGeneralDataService *gds, RsNetworkExchangeService *ne
|
|||
RsTickEvent::schedule_in(GXSID_EVENT_REPUTATION, REPUTATION_PERIOD);
|
||||
RsTickEvent::schedule_now(GXSID_EVENT_CACHEOWNIDS);
|
||||
|
||||
#ifndef GXS_DEV_TESTNET // NO RESET, OR DUMMYDATA for TESTNET
|
||||
//RsTickEvent::schedule_in(GXSID_EVENT_CACHETEST, CACHETEST_PERIOD);
|
||||
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_CACHETEST, CACHETEST_PERIOD);
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
RsTickEvent::schedule_now(GXSID_EVENT_DUMMYDATA);
|
||||
#endif
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
//RsTickEvent::schedule_now(GXSID_EVENT_DUMMYDATA);
|
||||
#endif
|
||||
|
||||
loadRecognKeys();
|
||||
|
@ -173,7 +170,7 @@ const uint16_t GXSID_MIN_MINOR_VERSION = 0;
|
|||
|
||||
RsServiceInfo p3IdService::getServiceInfo()
|
||||
{
|
||||
return RsServiceInfo(RS_SERVICE_GXSV2_TYPE_GXSID,
|
||||
return RsServiceInfo(RS_SERVICE_GXS_TYPE_GXSID,
|
||||
GXSID_APP_NAME,
|
||||
GXSID_APP_MAJOR_VERSION,
|
||||
GXSID_APP_MINOR_VERSION,
|
||||
|
@ -2091,10 +2088,10 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte
|
|||
std::cerr << std::endl;
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
if (item->group.mMeta.mAuthorId != "")
|
||||
{
|
||||
ownId = RsPgpId(item->group.mMeta.mAuthorId);
|
||||
}
|
||||
// if (item->group.mMeta.mAuthorId != "")
|
||||
// {
|
||||
// ownId = RsPgpId(item->group.mMeta.mAuthorId);
|
||||
// }
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ std::ostream &operator<<(std::ostream &out, const RsPhotoAlbum &album)
|
|||
}
|
||||
|
||||
p3PhotoService::p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs)
|
||||
: RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_GXSV2_TYPE_PHOTO, gixs, photoAuthenPolicy()),
|
||||
: RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_GXS_TYPE_PHOTO, gixs, photoAuthenPolicy()),
|
||||
mPhotoMutex(std::string("Photo Mutex"))
|
||||
{
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ const uint16_t GXS_PHOTO_MIN_MINOR_VERSION = 0;
|
|||
|
||||
RsServiceInfo p3PhotoService::getServiceInfo()
|
||||
{
|
||||
return RsServiceInfo(RS_SERVICE_GXSV2_TYPE_PHOTO,
|
||||
return RsServiceInfo(RS_SERVICE_GXS_TYPE_PHOTO,
|
||||
GXS_PHOTO_APP_NAME,
|
||||
GXS_PHOTO_APP_MAJOR_VERSION,
|
||||
GXS_PHOTO_APP_MINOR_VERSION,
|
||||
|
|
|
@ -39,7 +39,7 @@ RsPosted *rsPosted = NULL;
|
|||
/********************************************************************************/
|
||||
|
||||
p3Posted::p3Posted(RsGeneralDataService *gds, RsNetworkExchangeService *nes, RsGixs* gixs)
|
||||
:p3PostBase(gds, nes, gixs, new RsGxsPostedSerialiser(), RS_SERVICE_GXSV2_TYPE_POSTED),
|
||||
:p3PostBase(gds, nes, gixs, new RsGxsPostedSerialiser(), RS_SERVICE_GXS_TYPE_POSTED),
|
||||
RsPosted(this)
|
||||
{
|
||||
return;
|
||||
|
@ -54,7 +54,7 @@ const uint16_t GXS_POSTED_MIN_MINOR_VERSION = 0;
|
|||
|
||||
RsServiceInfo p3Posted::getServiceInfo()
|
||||
{
|
||||
return RsServiceInfo(RS_SERVICE_GXSV2_TYPE_POSTED,
|
||||
return RsServiceInfo(RS_SERVICE_GXS_TYPE_POSTED,
|
||||
GXS_POSTED_APP_NAME,
|
||||
GXS_POSTED_APP_MAJOR_VERSION,
|
||||
GXS_POSTED_APP_MINOR_VERSION,
|
||||
|
|
|
@ -43,7 +43,7 @@ RsWiki *rsWiki = NULL;
|
|||
#define DUMMYTICK_PERIOD 3
|
||||
|
||||
p3Wiki::p3Wiki(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs)
|
||||
:RsGenExchange(gds, nes, new RsGxsWikiSerialiser(), RS_SERVICE_GXSV2_TYPE_WIKI, gixs, wikiAuthenPolicy()),
|
||||
:RsGenExchange(gds, nes, new RsGxsWikiSerialiser(), RS_SERVICE_GXS_TYPE_WIKI, gixs, wikiAuthenPolicy()),
|
||||
RsWiki(this)
|
||||
{
|
||||
// Setup of dummy Pages.
|
||||
|
@ -65,7 +65,7 @@ const uint16_t GXS_WIKI_MIN_MINOR_VERSION = 0;
|
|||
|
||||
RsServiceInfo p3Wiki::getServiceInfo()
|
||||
{
|
||||
return RsServiceInfo(RS_SERVICE_GXSV2_TYPE_WIKI,
|
||||
return RsServiceInfo(RS_SERVICE_GXS_TYPE_WIKI,
|
||||
GXS_WIKI_APP_NAME,
|
||||
GXS_WIKI_APP_MAJOR_VERSION,
|
||||
GXS_WIKI_APP_MINOR_VERSION,
|
||||
|
|
|
@ -36,7 +36,7 @@ RsWire *rsWire = NULL;
|
|||
|
||||
|
||||
p3Wire::p3Wire(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs)
|
||||
:RsGenExchange(gds, nes, new RsGxsWireSerialiser(), RS_SERVICE_GXSV2_TYPE_WIRE, gixs, wireAuthenPolicy()),
|
||||
:RsGenExchange(gds, nes, new RsGxsWireSerialiser(), RS_SERVICE_GXS_TYPE_WIRE, gixs, wireAuthenPolicy()),
|
||||
RsWire(this), mWireMtx("WireMtx")
|
||||
{
|
||||
|
||||
|
@ -51,7 +51,7 @@ const uint16_t WIRE_MIN_MINOR_VERSION = 0;
|
|||
|
||||
RsServiceInfo p3Wire::getServiceInfo()
|
||||
{
|
||||
return RsServiceInfo(RS_SERVICE_GXSV2_TYPE_WIRE,
|
||||
return RsServiceInfo(RS_SERVICE_GXS_TYPE_WIRE,
|
||||
WIRE_APP_NAME,
|
||||
WIRE_APP_MAJOR_VERSION,
|
||||
WIRE_APP_MINOR_VERSION,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue