Merge pull request #1555 from G10h4ck/purge_deadcode

Purge deadcode
This commit is contained in:
csoler 2019-05-06 23:16:05 +02:00 committed by GitHub
commit 0a541667a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 27 additions and 378 deletions

View File

@ -560,9 +560,7 @@ SOURCES += pqi/authgpg.cc \
pqi/pqiqosstreamer.cc \
pqi/sslfns.cc \
pqi/pqinetstatebox.cc \
pqi/p3servicecontrol.cc \
# pqi/p3dhtmgr.cc \
pqi/p3servicecontrol.cc
SOURCES += rsserver/p3face-config.cc \
rsserver/p3face-server.cc \
@ -574,7 +572,6 @@ SOURCES += rsserver/p3face-config.cc \
rsserver/rsinit.cc \
rsserver/rsaccounts.cc \
rsserver/rsloginhandler.cc \
rsserver/rstypes.cc \
rsserver/p3serverconfig.cc
SOURCES += grouter/p3grouter.cc \
@ -626,10 +623,6 @@ SOURCES += services/autoproxy/rsautoproxymonitor.cc \
SOURCES += turtle/p3turtle.cc \
turtle/rsturtleitem.cc
# turtle/turtlerouting.cc \
# turtle/turtlesearch.cc \
# turtle/turtletunnels.cc
SOURCES += util/folderiterator.cc \
util/rsdebug.cc \

View File

@ -1392,29 +1392,6 @@ RsServiceInfo::RsServiceInfo()
return;
}
std::ostream &operator<<(std::ostream &out, const RsPeerServiceInfo &info)
{
out << "RsPeerServiceInfo(" << info.mPeerId << ")";
out << std::endl;
std::map<uint32_t, RsServiceInfo>::const_iterator it;
for(it = info.mServiceList.begin(); it != info.mServiceList.end(); ++it)
{
out << "\t Service:" << it->first << " : ";
out << it->second;
out << std::endl;
}
return out;
}
std::ostream &operator<<(std::ostream &out, const RsServiceInfo &info)
{
out << "RsServiceInfo(" << info.mServiceType << "): " << info.mServiceName;
out << " Version(" << info.mVersionMajor << "," << info.mVersionMinor << ")";
out << " MinVersion(" << info.mMinVersionMajor << "," << info.mMinVersionMinor << ")";
return out;
}
std::ostream &operator<<(std::ostream &out, const ServicePeerFilter &filter)
{
out << "ServicePeerFilter DenyAll: " << filter.mDenyAll;

View File

@ -75,7 +75,7 @@ struct RsGxsGroupSummary : RsSerializable
*/
struct RsGxsChanges
{
RsGxsChanges(): mService(0){}
RsGxsChanges(): mService(nullptr){}
RsTokenService *mService;
std::map<RsGxsGroupId, std::set<RsGxsMessageId> > mMsgs;
std::map<RsGxsGroupId, std::set<RsGxsMessageId> > mMsgsMeta;

View File

@ -151,11 +151,9 @@ struct RsGxsIdGroup : RsSerializable
RsGenericSerializer::SerializeContext& ctx ) override;
};
std::ostream &operator<<(std::ostream &out, const RsGxsIdGroup &group);
// DATA TYPE FOR EXTERNAL INTERFACE.
struct RsRecognTag
struct RS_DEPRECATED RsRecognTag
{
RsRecognTag(uint16_t tc, uint16_t tt, bool v) :
tag_class(tc), tag_type(tt), valid(v) {}
@ -166,7 +164,7 @@ struct RsRecognTag
};
struct RsRecognTagDetails
struct RS_DEPRECATED RsRecognTagDetails
{
RsRecognTagDetails() :
valid_from(0), valid_to(0), tag_class(0), tag_type(0), is_valid(false),

View File

@ -485,14 +485,13 @@ public:
}
};
std::ostream &operator<<(std::ostream &out, const Rs::Msgs::MessageInfo &info);
class RsMsgs;
/**
* @brief Pointer to retroshare's message service
* @jsonapi{development}
*/
extern RsMsgs *rsMsgs;
extern RsMsgs* rsMsgs;
class RsMsgs
{

View File

@ -19,8 +19,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#ifndef RS_NOTIFY_GUI_INTERFACE_H
#define RS_NOTIFY_GUI_INTERFACE_H
#pragma once
#include <map>
#include <list>
@ -30,6 +29,7 @@
#include "rsturtle.h"
#include "rsgxsifacetypes.h"
#include "util/rsdeprecate.h"
class ChatId;
class ChatMessage;
@ -148,7 +148,7 @@ const uint32_t NOTIFY_HASHTYPE_FINISH = 2; /* Finish */
const uint32_t NOTIFY_HASHTYPE_HASH_FILE = 3; /* Hashing file */
const uint32_t NOTIFY_HASHTYPE_SAVE_FILE_INDEX = 4; /* Hashing file */
class RsFeedItem
class RS_DEPRECATED RsFeedItem
{
public:
RsFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3, const std::string& id4, uint32_t result1)
@ -181,9 +181,9 @@ class RsFeedItem
// This mechanism can be used in plugins, new services, etc.
//
class NotifyClient;
class RS_DEPRECATED NotifyClient;
class RsNotify
class RS_DEPRECATED_FOR(RsEvents) RsNotify
{
public:
/* registration of notifies clients */
@ -206,7 +206,7 @@ class RsNotify
virtual bool setDisableAskPassword (const bool /*bValue*/) { return false ; }
};
class NotifyClient
class RS_DEPRECATED NotifyClient
{
public:
NotifyClient() {}
@ -223,8 +223,6 @@ public:
virtual void notifyCustomState (const std::string& /* peer_id */, const std::string& /* status_string */) {}
virtual void notifyHashingInfo (uint32_t /* type */, const std::string& /* fileinfo */) {}
virtual void notifyTurtleSearchResult (const RsPeerId& /* pid */, uint32_t /* search_id */, const std::list<TurtleFileInfo>& /* files */) {}
#warning MISSING CODE HERE
// virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list<TurtleGxsInfo >& /* groups */) {}
virtual void notifyPeerHasNewAvatar (std::string /* peer_id */) {}
virtual void notifyOwnAvatarChanged () {}
virtual void notifyOwnStatusMessageChanged () {}
@ -245,4 +243,3 @@ public:
virtual bool askForPassword (const std::string& /* title */, const std::string& /* key_details */, bool /* prev_is_bad */, std::string& /* password */,bool& /* cancelled */ ) { return false ;}
virtual bool askForPluginConfirmation (const std::string& /* plugin_filename */, const std::string& /* plugin_file_hash */,bool /* first_time */) { return false ;}
};
#endif

View File

@ -358,8 +358,6 @@ struct RsGroupInfo : RsSerializable
}
};
std::ostream &operator<<(std::ostream &out, const RsPeerDetails &detail);
/** The Main Interface Class - for information about your Peers
* A peer is another RS instance, means associated with an SSL certificate
* A same GPG person can have multiple peer running with different SSL certs

View File

@ -88,10 +88,6 @@ struct RsPeerServiceInfo : RsSerializable
}
};
std::ostream &operator<<(std::ostream &out, const RsPeerServiceInfo &info);
std::ostream &operator<<(std::ostream &out, const RsServiceInfo &info);
struct RsServicePermissions : RsSerializable
{
RsServicePermissions();

View File

@ -107,9 +107,6 @@ struct RsTokReqOptions
rstime_t mAfter;
};
std::ostream &operator<<(std::ostream &out, const RsGroupMetaData &meta);
std::ostream &operator<<(std::ostream &out, const RsMsgMetaData &meta);
/*!
* A proxy class for requesting generic service data for GXS
* This seperates the request mechanism from the actual retrieval of data

View File

@ -248,8 +248,6 @@ struct FileInfo : RsSerializable
}
};
std::ostream &operator<<(std::ostream &out, const FileInfo& info);
/**
* Pointers in this class have no real meaning as pointers, they are used as
* indexes, internally by retroshare.
@ -370,8 +368,6 @@ struct DirDetails : RsSerializable
}
};
std::ostream &operator<<(std::ostream &out, const DirDetails& details);
class FileDetail
{
public:

View File

@ -67,11 +67,9 @@ public:
// Avatar
RsTlvImage mImage ;
};
class RsGxsIdLocalInfoItem : public RsGxsIdItem
struct RsGxsIdLocalInfoItem : public RsGxsIdItem
{
public:
RsGxsIdLocalInfoItem(): RsGxsIdItem(RS_PKT_SUBTYPE_GXSID_LOCAL_INFO_ITEM) {}
virtual ~RsGxsIdLocalInfoItem() {}
@ -83,39 +81,6 @@ public:
std::set<RsGxsId> mContacts ;
};
#if 0
class RsGxsIdOpinionItem : public RsGxsMsgItem
{
public:
RsGxsIdOpinionItem(): RsGxsMsgItem(RS_SERVICE_GXS_TYPE_GXSID,
RS_PKT_SUBTYPE_GXSID_OPINION_ITEM) {return; }
virtual ~RsGxsIdOpinionItem() { return;}
void clear();
virtual bool serialise(void *data,uint32_t& size) = 0 ;
virtual uint32_t serial_size() = 0 ;
std::ostream &print(std::ostream &out, uint16_t indent = 0);
RsGxsIdOpinion opinion;
};
class RsGxsIdCommentItem : public RsGxsMsgItem
{
public:
RsGxsIdCommentItem(): RsGxsMsgItem(RS_SERVICE_GXS_TYPE_GXSID,
RS_PKT_SUBTYPE_GXSID_COMMENT_ITEM) { return; }
virtual ~RsGxsIdCommentItem() { return; }
void clear();
virtual bool serialise(void *data,uint32_t& size) = 0 ;
virtual uint32_t serial_size() = 0 ;
std::ostream &print(std::ostream &out, uint16_t indent = 0);
RsGxsIdComment comment;
};
#endif
class RsGxsIdSerialiser : public RsServiceSerializer
{
public:

View File

@ -62,30 +62,9 @@
this->mInternalCircle = rGxsMeta.mInternalCircle;
this->mOriginator = rGxsMeta.mOriginator;
this->mAuthenFlags = rGxsMeta.mAuthenFlags;
// std::cout << "rGxsMeta.mParentGrpId= " <<rGxsMeta.mParentGrpId<<"\n";
// std::cout << "rGxsMeta.mParentGrpId.length()= " <<rGxsMeta.mParentGrpId.length()<<"\n";
//std::cout << "this->mParentGrpId= " <<this->mParentGrpId<<"\n";
this->mParentGrpId = rGxsMeta.mParentGrpId;
}
std::ostream &operator<<(std::ostream &out, const RsGroupMetaData &meta)
{
out << "[ GroupId: " << meta.mGroupId << " Name: " << meta.mGroupName << " ]";
return out;
}
std::ostream &operator<<(std::ostream &out, const RsMsgMetaData &meta)
{
out << "[ GroupId: " << meta.mGroupId << " MsgId: " << meta.mMsgId;
out << " Name: " << meta.mMsgName;
out << " OrigMsgId: " << meta.mOrigMsgId;
out << " ThreadId: " << meta.mThreadId;
out << " ParentId: " << meta.mParentId;
out << " AuthorId: " << meta.mAuthorId;
out << " Name: " << meta.mMsgName << " ]";
return out;
}
template<> uint32_t RsTypeSerializer::serial_size(const TurtleGxsInfo& i)
{
uint32_t s = 0 ;

View File

@ -28,9 +28,6 @@
#include "util/rstime.h"
#include "retroshare/rsgxsifacetypes.h"
std::ostream &operator<<(std::ostream &out, const RsGroupMetaData &meta);
std::ostream &operator<<(std::ostream &out, const RsMsgMetaData &meta);
class RsGxsGrpItem : public RsItem
{

View File

@ -1486,63 +1486,9 @@ RsPeerDetails::RsPeerDetails()
lastConnect(0),lastUsed(0),connectState(0),connectStateString(""),
connectPeriod(0),
foundDHT(false), wasDeniedConnection(false), deniedTS(0),
linkType ( RS_NET_CONN_TRANS_TCP_UNKNOWN)
{
}
linkType ( RS_NET_CONN_TRANS_TCP_UNKNOWN) {}
std::ostream &operator<<(std::ostream &out, const RsPeerDetails &detail)
{
out << "RsPeerDetail: " << detail.name << " <" << detail.id << ">";
out << std::endl;
out << " email: " << detail.email;
out << " location:" << detail.location;
out << " org: " << detail.org;
out << std::endl;
out << " fpr: " << detail.fpr;
out << " authcode:" << detail.authcode;
out << std::endl;
out << " signers:";
out << std::endl;
std::list<RsPgpId>::const_iterator it;
for(it = detail.gpgSigners.begin();
it != detail.gpgSigners.end(); ++it)
{
out << "\t" << *it;
out << std::endl;
}
out << std::endl;
out << " trustLvl: " << detail.trustLvl;
out << " ownSign: " << detail.ownsign;
out << std::endl;
out << " state: " << detail.state;
out << " netMode: " << detail.netMode;
out << std::endl;
out << " localAddr: " << detail.localAddr;
out << ":" << detail.localPort;
out << std::endl;
out << " extAddr: " << detail.extAddr;
out << ":" << detail.extPort;
out << std::endl;
out << " lastConnect: " << detail.lastConnect;
out << " connectPeriod: " << detail.connectPeriod;
out << std::endl;
return out;
}
RsGroupInfo::RsGroupInfo()
{
flag = 0;
}
RsGroupInfo::RsGroupInfo() : flag(0) {}
ServicePermissionFlags p3Peers::servicePermissionFlags(const RsPeerId& ssl_id)
{

View File

@ -1,72 +0,0 @@
/*******************************************************************************
* libretroshare/src/rsserver: rstypes.cc *
* *
* libretroshare: retroshare core library *
* *
* Copyright 2004-2006 by Robert Fernie <retroshare.project@gmail.com> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
/* Insides of RetroShare interface.
* only prints stuff out at the moment
*/
#include "retroshare/rstypes.h"
#include <iostream>
#include <iomanip>
#include "util/rstime.h"
/**********************************************************************
* NOTE NOTE NOTE ...... XXX
* BUG in MinGW .... %hhx in sscanf overwrites 32bits, instead of 8bits.
* this means that scanf(.... &(data[15])) is running off the
* end of the buffer, and hitting data[15-18]...
* To work around this bug we are reading into proper int32s
* and then copying the data over...
*
**********************************************************************/
std::ostream &operator<<(std::ostream &out, const DirDetails& d)
{
std::cerr << "====DIR DETAILS====" << std::endl;
std::cerr << " parent pointer: " << d.parent << std::endl;
std::cerr << " current pointer: " << d.ref << std::endl;
std::cerr << " parent row : " << d.prow << std::endl;
std::cerr << " type : " << (int)d.type << std::endl;
std::cerr << " PeerId : " << d.id << std::endl;
std::cerr << " Name : " << d.name << std::endl;
std::cerr << " Hash : " << d.hash << std::endl;
std::cerr << " Path : " << d.path << std::endl;
std::cerr << " Count : " << d.count << std::endl;
std::cerr << " Age : " << time(NULL) - (int)d.mtime << std::endl;
std::cerr << " Min age : " << time(NULL) - (int)d.max_mtime << std::endl;
std::cerr << " Flags : " << d.flags << std::endl;
std::cerr << " Parent groups : " ; for(std::list<RsNodeGroupId>::const_iterator it(d.parent_groups.begin());it!=d.parent_groups.end();++it) std::cerr << (*it) << " "; std::cerr << std::endl;
std::cerr << " Children : " ; for(uint32_t i=0;i<d.children.size();++i) std::cerr << (void*)(intptr_t)d.children[i].ref << " "; std::cerr << std::endl;
std::cerr << "===================" << std::endl;
return out;
}
std::ostream &operator<<(std::ostream &out, const FileInfo &info)
{
out << "FileInfo: path: " << info.path;
out << std::endl;
out << "File: " << info.fname;
out << " Size: " << info.size;
out << std::endl;
out << "Hash: " << info.hash;
return out;
}

View File

@ -40,7 +40,7 @@
* #define DEBUG_CIRCLES 1
****/
RsGxsCircles *rsGxsCircles = NULL;
/*extern*/ RsGxsCircles* rsGxsCircles = nullptr;
/******
*
@ -1858,47 +1858,6 @@ void p3GxsCircles::generateDummyCircle()
createGroup(dummyToken, group);
}
/************************************************************************************/
/************************************************************************************/
/************************************************************************************/
/************************************************************************************/
std::ostream &operator<<(std::ostream &out, const RsGxsCircleGroup &grp)
{
out << "RsGxsCircleGroup: Meta: " << grp.mMeta;
out << "InvitedMembers: ";
out << std::endl;
std::set<RsGxsId>::const_iterator it;
std::set<RsGxsCircleId>::const_iterator sit;
for(it = grp.mInvitedMembers.begin();
it != grp.mInvitedMembers.begin(); ++it)
{
out << "\t" << *it;
out << std::endl;
}
for(sit = grp.mSubCircles.begin();
sit != grp.mSubCircles.begin(); ++sit)
{
out << "\t" << *it;
out << std::endl;
}
return out;
}
std::ostream &operator<<(std::ostream &out, const RsGxsCircleMsg &msg)
{
out << "RsGxsCircleMsg: Meta: " << msg.mMeta;
out << std::endl;
return out;
}
// Overloaded from GxsTokenQueue for Request callbacks.
void p3GxsCircles::handleResponse(uint32_t token, uint32_t req_type)
{
@ -1921,22 +1880,13 @@ void p3GxsCircles::handleResponse(uint32_t token, uint32_t req_type)
case CIRCLEREQ_CACHELOAD:
cache_load_for_token(token);
break;
#if 0
case CIRCLEREQ_CACHETEST:
cachetest_handlerequest(token);
break;
#endif
default:
/* error */
std::cerr << "p3GxsCircles::handleResponse() Unknown Request Type: " << req_type;
std::cerr << std::endl;
RsErr() << __PRETTY_FUNCTION__ << " Unknown Request Type: "
<< req_type << std::endl;
break;
}
}
// Overloaded from RsTickEvent for Event callbacks.
void p3GxsCircles::handle_event(uint32_t event_type, const std::string &elabel)
{
@ -1960,13 +1910,6 @@ void p3GxsCircles::handle_event(uint32_t event_type, const std::string &elabel)
cache_reloadids(RsGxsCircleId(elabel));
break;
#if 0
case CIRCLE_EVENT_CACHETEST:
cachetest_getlist();
break;
#endif
case CIRCLE_EVENT_DUMMYSTART:
generateDummyData();
break;
@ -1980,9 +1923,8 @@ void p3GxsCircles::handle_event(uint32_t event_type, const std::string &elabel)
break;
default:
/* error */
std::cerr << "p3GxsCircles::handle_event() Unknown Event Type: " << event_type;
std::cerr << std::endl;
RsErr() << __PRETTY_FUNCTION__ << " Unknown Event Type: " << event_type
<< std::endl;
break;
}
}

View File

@ -4542,65 +4542,6 @@ std::string rsIdTypeToString(uint32_t idtype)
*
*/
/************************************************************************************/
/*
* Scoring system.
* -100 to 100 is expected range.
*
*
* Each Lobby has a publish threshold.
* - As part of Lobby definition. ???
* - Locally Set.
*
* Threshold:
* 50 VIP List.
* 20 Dress Code
* 10 Limit Riffraff.
* 0 Accept All.
*
* Implicit Scores:
* +50 for known PGP
* +10 for unknown PGP (want to encourage usage).
* +5 for Anon ID.
*
* Own Scores:
* +1000 Accepted
* +50 Friend
* +10 Interesting
* 0 Mostly Harmless
* -10 Annoying.
* -50 Troll
* -1000 Total Banned
*
*
*
Processing Algorithm:
* - Grab all Groups which have received messages.
* (opt 1)-> grab latest msgs for each of these and process => score.
* (opt 2)-> try incremental system (people probably won't change opinions often -> just set them once)
* --> if not possible, fallback to full calculation.
*
*
*/
std::ostream &operator<<(std::ostream &out, const RsGxsIdGroup &grp)
{
out << "RsGxsIdGroup: Meta: " << grp.mMeta;
out << " PgpIdHash: " << grp.mPgpIdHash;
out << " PgpIdSign: [binary]"; // << grp.mPgpIdSign;
out << std::endl;
return out;
}
void p3IdService::checkPeerForIdentities()
{
RsStackMutex stack(mIdMtx);