Merge pull request #775 from csoler/v0.6-PRTest

V0.6 pr test
This commit is contained in:
csoler 2017-04-17 22:03:48 +02:00 committed by GitHub
commit 4faaaf7093
56 changed files with 151 additions and 136 deletions

View File

@ -58,7 +58,7 @@
/*************************************/
UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, std::string bootstrapfile, const std::string& filteredipfile, bdDhtFunctions *fns)
:UdpSubReceiver(pub), dhtMtx(true), mFns(fns)
:UdpSubReceiver(pub), dhtMtx(true)//, mFns(fns)
{
std::string usedVersion;

View File

@ -119,7 +119,7 @@ void clearDataTransferred();
bdMutex dhtMtx; /* for all class data (below) */
bdNodeManager *mBitDhtManager;
bdDhtFunctions *mFns;
//bdDhtFunctions *mFns;
uint32_t mReadBytes;

View File

@ -10,8 +10,8 @@
namespace resource_api
{
FileSearchHandler::FileSearchHandler(StateTokenServer *sts, RsNotify *notify, RsTurtle *turtle, RsFiles *files):
mStateTokenServer(sts), mNotify(notify), mTurtle(turtle), mFiles(files),
FileSearchHandler::FileSearchHandler(StateTokenServer *sts, RsNotify *notify, RsTurtle *turtle, RsFiles */*files*/):
mStateTokenServer(sts), mNotify(notify), mTurtle(turtle),// mFiles(files),
mMtx("FileSearchHandler")
{
mNotify->registerNotifyClient(this);

View File

@ -24,7 +24,7 @@ private:
StateTokenServer* mStateTokenServer;
RsNotify* mNotify;
RsTurtle* mTurtle;
RsFiles* mFiles;
//RsFiles* mFiles;
class Search{
public:

View File

@ -200,7 +200,7 @@ static bool have_avatar(RsMsgs* msgs, const RsPeerId& id)
return size != 0;
}
void PeersHandler::handleGetStateString(Request& req, Response& resp)
void PeersHandler::handleGetStateString(Request& /*req*/, Response& resp)
{
{
RS_STACK_MUTEX(mMtx);
@ -234,7 +234,7 @@ void PeersHandler::handleSetStateString(Request& req, Response& resp)
std::string state_string;
req.mStream << makeKeyValueReference("state_string", state_string);
uint32_t status;
uint32_t status = RS_STATUS_OFFLINE;
if(state_string == "online")
status = RS_STATUS_ONLINE;
else if(state_string == "busy")
@ -246,7 +246,7 @@ void PeersHandler::handleSetStateString(Request& req, Response& resp)
resp.setOk();
}
void PeersHandler::handleGetCustomStateString(Request& req, Response& resp)
void PeersHandler::handleGetCustomStateString(Request& /*req*/, Response& resp)
{
{
RS_STACK_MUTEX(mMtx);

View File

@ -34,8 +34,8 @@
#include "serialiser/rstlvkeys.h"
#include "serialiser/rsgxsitems.h"
class RsGroupMetaData;
class RsMsgMetaData;
struct RsGroupMetaData;
struct RsMsgMetaData;
static const uint32_t RS_GXS_GRP_META_DATA_VERSION_ID_0001 = 0x0000 ; // change this, and keep old values if the content changes
static const uint32_t RS_GXS_GRP_META_DATA_VERSION_ID_0002 = 0xaf01 ; // current API

View File

@ -1972,7 +1972,7 @@ void RsGxsNetService::updateServerSyncTS()
#endif
// I keep the creation, but the data is not used yet.
#warning disabled this, but do we need it?
#warning csoler 2016-12-12: Disabled this, but do we need it?
// RsGxsServerMsgUpdate& msui(mServerMsgUpdateMap[grpId]) ;
// (cyril) I'm removing this, because the msgUpdateTS is updated when new messages are received by calling locked_stampMsgServerUpdateTS().
@ -3000,7 +3000,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
}
// FIXTESTS global variable rsReputations not available in unittests!
#warning Update the code below to correctly send/recv dependign on reputation
#warning csoler 2016-12-23: Update the code below to correctly send/recv dependign on reputation
if(!grpSyncItem->authorId.isNull() && mReputations->overallReputationLevel(grpSyncItem->authorId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{
#ifdef NXS_NET_DEBUG_0

View File

@ -45,7 +45,7 @@ bool AuthorPending::getAuthorRep(GixsReputation& rep, const RsGxsId& authorId, c
rep.id = authorId ;
rep.reputation_level = mRep->overallReputationLevel(authorId);
#warning can it happen that reputations do not have the info yet?
#warning csoler 2017-01-10: Can it happen that reputations do not have the info yet?
return true ;
#ifdef TO_BE_REMOVED
{

View File

@ -1193,7 +1193,7 @@ bool p3GxsTunnelService::locked_sendClearTunnelData(RsGxsTunnelDHPublicKeyItem *
if(gitem->data_bytes == NULL)
{
delete gitem ;
return NULL ;
return false ;
}
// by convention, we use a IV of 0 for unencrypted data.
memset(gitem->data_bytes,0,8) ;

View File

@ -51,6 +51,11 @@ RsPluginManager::RsPluginManager(const RsFileHash &hash)
_allow_all_plugins = false ;
}
bool RsPluginManager::loadConfiguration(RsFileHash &loadHash)
{
return p3Config::loadConfiguration(loadHash);
}
void RsPluginManager::loadConfiguration()
{
RsFileHash dummyHash;

View File

@ -74,6 +74,7 @@ class RsPluginManager: public RsPluginHandler, public p3Config
// -------------------- Own members -------------------------//
//
virtual void addConfigurations(p3ConfigMgr *cfgMgr) ;
virtual bool loadConfiguration(RsFileHash &loadHash) ;
virtual void loadConfiguration() ;
/*!

View File

@ -92,7 +92,7 @@ dhtPeerEntry::dhtPeerEntry()
return;
}
p3DhtMgr::p3DhtMgr(std::string id, pqiConnectCb *cb)
p3DhtMgr::p3DhtMgr(RsPeerId id, pqiConnectCb *cb)
:pqiNetAssistConnect(id, cb), dhtMtx("p3DhtMgr"), mStunRequired(true)
{
/* setup own entry */
@ -237,13 +237,13 @@ bool p3DhtMgr::setExternalInterface(
/* add / remove peers */
bool p3DhtMgr::findPeer(std::string id)
bool p3DhtMgr::findPeer(const RsPeerId& id)
{
RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/
mDhtModifications = true;
std::map<std::string, dhtPeerEntry>::iterator it;
std::map<RsPeerId, dhtPeerEntry>::iterator it;
it = peers.find(id);
if (it != peers.end())
{
@ -281,14 +281,14 @@ bool p3DhtMgr::findPeer(std::string id)
return true;
}
bool p3DhtMgr::dropPeer(std::string id)
bool p3DhtMgr::dropPeer(const RsPeerId& id)
{
RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/
mDhtModifications = true;
/* once we are connected ... don't worry about them anymore */
std::map<std::string, dhtPeerEntry>::iterator it;
std::map<RsPeerId, dhtPeerEntry>::iterator it;
it = peers.find(id);
if (it == peers.end())
{
@ -302,14 +302,14 @@ bool p3DhtMgr::dropPeer(std::string id)
}
/* post DHT key saying we should connect */
bool p3DhtMgr::notifyPeer(std::string id)
bool p3DhtMgr::notifyPeer(const RsPeerId& id)
{
RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/
#ifdef DHT_DEBUG
std::cerr << "p3DhtMgr::notifyPeer() " << id << std::endl;
std::cerr << "p3DhtMgr::notifyPeer() " << id.toStdString() << std::endl;
#endif
std::map<std::string, dhtPeerEntry>::iterator it;
std::map<RsPeerId, dhtPeerEntry>::iterator it;
it = peers.find(id);
if (it == peers.end())
{
@ -333,7 +333,7 @@ bool p3DhtMgr::notifyPeer(std::string id)
#ifdef DHT_LOGS
{
/* Log */
rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id + " TO SOON - DROPPING");
rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id.toStdString() + " TO SOON - DROPPING");
}
#endif
@ -352,7 +352,7 @@ bool p3DhtMgr::notifyPeer(std::string id)
#ifdef DHT_LOGS
{
/* Log */
rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id + " PEER NOT FOUND - Trigger Search");
rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id.toStdString() + " PEER NOT FOUND - Trigger Search");
}
#endif
it->second.lastTS = 0;
@ -364,14 +364,14 @@ bool p3DhtMgr::notifyPeer(std::string id)
}
/* extract current peer status */
bool p3DhtMgr::getPeerStatus(std::string id,
bool p3DhtMgr::getPeerStatus(const RsPeerId &id,
struct sockaddr_in &laddr,
struct sockaddr_in &raddr,
uint32_t &type, uint32_t &state)
{
RsStackMutex stack(dhtMtx); /* LOCK MUTEX */
std::map<std::string, dhtPeerEntry>::iterator it;
std::map<RsPeerId, dhtPeerEntry>::iterator it;
it = peers.find(id);
/* ignore OFF peers */
@ -776,7 +776,7 @@ int p3DhtMgr::checkPeerDHTKeys()
dhtMtx.lock(); /* LOCK MUTEX */
/* iterate through and find min time and suitable candidate */
std::map<std::string, dhtPeerEntry>::iterator it,pit;
std::map<RsPeerId, dhtPeerEntry>::iterator it,pit;
time_t now = time(NULL);
uint32_t period = 0;
uint32_t repeatPeriod = 6000;
@ -802,7 +802,7 @@ int p3DhtMgr::checkPeerDHTKeys()
period = DHT_CHECK_PERIOD;
}
#ifdef DHT_DEBUG
std::cerr << "p3DhtMgr::checkPeerDHTKeys() Peer: " << it->second.id;
std::cerr << "p3DhtMgr::checkPeerDHTKeys() Peer: " << it->second.id.toStdString();
std::cerr << " Period: " << period;
std::cerr << " Delta: " << delta;
std::cerr << std::endl;
@ -865,7 +865,7 @@ int p3DhtMgr::checkNotifyDHT()
RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/
/* iterate through and find min time and suitable candidate */
std::map<std::string, dhtPeerEntry>::iterator it;
std::map<RsPeerId, dhtPeerEntry>::iterator it;
time_t now = time(NULL);
int repeatPeriod = DHT_DEFAULT_PERIOD;
@ -1015,7 +1015,7 @@ int p3DhtMgr::checkStunState()
if (mDhtState == DHT_STATE_CHECK_PEERS)
{
/* check that they have all be searched for */
std::map<std::string, dhtPeerEntry>::iterator it;
std::map<RsPeerId, dhtPeerEntry>::iterator it;
for(it = peers.begin(); it != peers.end(); it++)
{
if (it->second.state == DHT_PEER_INIT)
@ -1287,7 +1287,7 @@ int p3DhtMgr::status(std::ostream &out)
out << "OWN DETAILS END----------------------------------------" << std::endl;
/* now peers states */
std::map<std::string, dhtPeerEntry>::iterator it;
std::map<RsPeerId, dhtPeerEntry>::iterator it;
out << "PEER DETAILS ------------------------------------------" << std::endl;
for(it = peers.begin(); it != peers.end(); it++)
{
@ -1622,15 +1622,13 @@ bool p3DhtMgr::dhtResultNotify(std::string idhash)
std::cerr << "p3DhtMgr::dhtResultNotify() from idhash: ";
std::cerr << RsUtil::BinToHex(idhash) << std::endl;
#endif
std::map<std::string, dhtPeerEntry>::iterator it;
std::map<RsPeerId, dhtPeerEntry>::iterator it;
time_t now = time(NULL);
/* if notify - we must match on the second hash */
for(it = peers.begin(); (it != peers.end()) && ((it->second).hash2 != idhash); it++) ;
/* update data */
std::string peerid;
/* ignore OFF peers */
if ((it != peers.end()) && (it->second.state != DHT_PEER_OFF))
{
@ -1677,7 +1675,7 @@ bool p3DhtMgr::dhtResultSearch(std::string idhash,
std::cerr << "p3DhtMgr::dhtResultSearch() for idhash: ";
std::cerr << RsUtil::BinToHex(idhash) << std::endl;
#endif
std::map<std::string, dhtPeerEntry>::iterator it;
std::map<RsPeerId, dhtPeerEntry>::iterator it;
bool doCb = false;
bool doStun = false;
uint32_t stunFlags = 0;
@ -1780,7 +1778,7 @@ bool p3DhtMgr::dhtResultSearch(std::string idhash,
void printDhtPeerEntry(dhtPeerEntry *ent, std::ostream &out)
{
out << "DhtEntry: ID: " << ent->id;
out << "DhtEntry: ID: " << ent->id.toStdString();
out << " State: " << ent->state;
out << " lastTS: " << ent->lastTS;
out << " notifyPending: " << ent->notifyPending;

View File

@ -78,7 +78,7 @@ class dhtPeerEntry
public:
dhtPeerEntry();
std::string id;
RsPeerId id;
uint32_t state;
time_t lastTS;
@ -97,7 +97,7 @@ class p3DhtMgr: public pqiNetAssistConnect, public RsThread
/*
*/
public:
p3DhtMgr(std::string id, pqiConnectCb *cb);
p3DhtMgr(RsPeerId id, pqiConnectCb *cb);
/********** External DHT Interface ************************
* These Functions are the external interface
@ -121,14 +121,14 @@ virtual bool setExternalInterface(struct sockaddr_in laddr,
struct sockaddr_in raddr, uint32_t type);
/* add / remove peers */
virtual bool findPeer(std::string id);
virtual bool dropPeer(std::string id);
virtual bool findPeer(const RsPeerId& id);
virtual bool dropPeer(const RsPeerId& id);
/* post DHT key saying we should connect (callback when done) */
virtual bool notifyPeer(std::string id);
virtual bool notifyPeer(const RsPeerId& id);
/* extract current peer status */
virtual bool getPeerStatus(std::string id,
virtual bool getPeerStatus(const RsPeerId& id,
struct sockaddr_in &laddr, struct sockaddr_in &raddr,
uint32_t &type, uint32_t &mode);
@ -154,17 +154,17 @@ virtual bool dhtResultBootstrap(std::string idhash);
protected:
/* can block briefly (called only from thread) */
virtual bool dhtPublish(std::string id,
virtual bool dhtPublish(std::string idhash,
struct sockaddr_in &laddr,
struct sockaddr_in &raddr,
uint32_t type, std::string sign);
virtual bool dhtNotify(std::string peerid, std::string ownId,
virtual bool dhtNotify(std::string idhash, std::string ownIdHash,
std::string sign);
virtual bool dhtSearch(std::string id, uint32_t mode);
virtual bool dhtSearch(std::string idhash, uint32_t mode);
virtual bool dhtBootstrap(std::string storehash, std::string ownIdHash,
virtual bool dhtBootstrap(std::string idhash, std::string ownIdHash,
std::string sign); /* to publish bootstrap */
@ -232,7 +232,7 @@ std::string randomBootstrapId();
dhtPeerEntry ownEntry;
time_t ownNotifyTS;
std::map<std::string, dhtPeerEntry> peers;
std::map<RsPeerId, dhtPeerEntry> peers;
std::list<std::string> stunIds;
bool mStunRequired;

View File

@ -397,7 +397,7 @@ private:
std::map<RsPeerId,sockaddr_storage> mReportedOwnAddresses ;
std::map<RsNodeGroupId,RsGroupInfo> groupList;
uint32_t lastGroupId;
//uint32_t lastGroupId;
std::list<RsItem *> saveCleanupList; /* TEMPORARY LIST WHEN SAVING */

View File

@ -61,13 +61,19 @@ void pqiConnectCbDummy::peerStatus(const RsPeerId& id, const pqiIpAddrSet &ad
std::cerr << out << std::endl;
}
void pqiConnectCbDummy::peerConnectRequest(const RsPeerId& id,
const struct sockaddr_storage &raddr, uint32_t source)
void pqiConnectCbDummy::peerConnectRequest(const RsPeerId &id, const sockaddr_storage &raddr
, const sockaddr_storage &proxyaddr, const sockaddr_storage &srcaddr
, uint32_t source, uint32_t flags, uint32_t delay, uint32_t bandwidth)
{
std::cerr << "pqiConnectCbDummy::peerConnectRequest()";
std::cerr << " id: " << id;
std::cerr << " raddr: " << sockaddr_storage_tostring(raddr);
std::cerr << " proxyaddr: " << sockaddr_storage_tostring(proxyaddr);
std::cerr << " srcaddr: " << sockaddr_storage_tostring(srcaddr);
std::cerr << " source: " << source;
std::cerr << " flags: " << flags;
std::cerr << " delay: " << delay;
std::cerr << " bandwidth: " << bandwidth;
std::cerr << std::endl;
}

View File

@ -179,8 +179,9 @@ virtual ~pqiConnectCbDummy();
virtual void peerStatus(const RsPeerId& id, const pqiIpAddrSet &addrs,
uint32_t type, uint32_t mode, uint32_t source);
virtual void peerConnectRequest(const RsPeerId& id,
const struct sockaddr_storage &raddr, uint32_t source);
virtual void peerConnectRequest(const RsPeerId& id, const struct sockaddr_storage &raddr,
const struct sockaddr_storage &proxyaddr, const struct sockaddr_storage &srcaddr,
uint32_t source, uint32_t flags, uint32_t delay, uint32_t bandwidth);
//virtual void stunStatus(std::string id, const struct sockaddr_storage &raddr, uint32_t type, uint32_t flags);
};

View File

@ -40,7 +40,7 @@ static struct RsLog::logInfo pqipersonzoneInfo = {RsLog::Default, "pqiperson"};
pqiperson::pqiperson(const RsPeerId& id, pqipersongrp *pg) :
PQInterface(id), mNotifyMtx("pqiperson-notify"), mPersonMtx("pqiperson"),
active(false), activepqi(NULL), inConnectAttempt(false), waittimes(0),
active(false), activepqi(NULL), inConnectAttempt(false),// waittimes(0),
pqipg(pg) {} // TODO: must check id!
pqiperson::~pqiperson()

View File

@ -29,6 +29,7 @@
#define MRK_PQI_PERSON_HEADER
#include <string>
#include "pqi/pqi.h"
#include "util/rsnet.h"
@ -66,7 +67,7 @@ public:
virtual int reset() { pqistreamer::reset(); return ni->reset(); }
virtual int disconnect() { return reset() ; }
virtual bool connect_parameter(uint32_t type, uint32_t value) { return ni->connect_parameter(type, value);}
virtual bool connect_parameter(uint32_t type, std::string value) { return ni->connect_parameter(type, value);}
virtual bool connect_parameter(uint32_t type, const std::string &value) { return ni->connect_parameter(type, value);}
virtual bool connect_additional_address(uint32_t type, const struct sockaddr_storage &addr) { return ni->connect_additional_address(type, addr); }
virtual int getConnectAddress(struct sockaddr_storage &raddr){ return ni->getConnectAddress(raddr); }
@ -171,7 +172,7 @@ private:
bool active;
pqiconnect *activepqi;
bool inConnectAttempt;
int waittimes;
//int waittimes;
time_t lastHeartbeatReceived; // use to track connection failure
pqipersongrp *pqipg; /* parent for callback */
};

View File

@ -1009,7 +1009,7 @@ int pqissl::Basic_Connection_Complete()
return -1;
}
else if ((err == ECONNREFUSED))
else if (err == ECONNREFUSED)
{
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() ECONNREFUSED: cert: " + PeerId().toStdString());

View File

@ -53,7 +53,7 @@ static const uint32_t PQI_SSLUDP_DEF_CONN_PERIOD = 300; /* 5 minutes? */
/********** PQI SSL UDP STUFF **************************************/
pqissludp::pqissludp(PQInterface *parent, p3LinkMgr *lm) :
pqissl(NULL, parent, lm), tou_bio(NULL), listen_checktime(0),
pqissl(NULL, parent, lm), tou_bio(NULL),// listen_checktime(0),
mConnectPeriod(PQI_SSLUDP_DEF_CONN_PERIOD), mConnectFlags(0),
mConnectBandwidth(0)
{

View File

@ -95,7 +95,7 @@ private:
BIO *tou_bio; // specific to ssludp.
long listen_checktime;
//long listen_checktime;
uint32_t mConnectPeriod;
uint32_t mConnectFlags;

View File

@ -627,7 +627,7 @@ bool getX509id(X509 *x509, RsPeerId& xid)
* more randomness
*/
#warning this is cryptographically horrible. We should do a hash of the public key here!!!
#warning csoler 2017-02-19: This is cryptographically horrible. We should do a hash of the public key here!!!
xid = RsPeerId(&signdata[signlen - CERTSIGNLEN]) ;

View File

@ -25,7 +25,7 @@ typedef std::pair<RsGxsGroupId, RsGxsMessageId> RsGxsGrpMsgIdPair;
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsGxsMessageId> > MsgRelatedIdResult;
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq;
class RsMsgMetaData;
struct RsMsgMetaData;
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > MsgMetaResult;

View File

@ -5,7 +5,7 @@
#include "retroshare/rsgxsifacetypes.h"
#include "retroshare/rstokenservice.h"
class RsMsgMetaData ;
struct RsMsgMetaData ;
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > GxsMsgMetaMap;
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsMsgMetaData> > GxsMsgRelatedMetaMap;

View File

@ -66,8 +66,8 @@
*/
RsBanList *rsBanList = NULL ;
p3BanList::p3BanList(p3ServiceControl *sc, p3NetMgr *nm)
:p3Service(), mBanMtx("p3BanList"), mServiceCtrl(sc), mNetMgr(nm)
p3BanList::p3BanList(p3ServiceControl *sc, p3NetMgr */*nm*/)
:p3Service(), mBanMtx("p3BanList"), mServiceCtrl(sc)//, mNetMgr(nm)
{
addSerialType(new RsBanListSerialiser());

View File

@ -148,7 +148,7 @@ private:
std::map<struct sockaddr_storage, BanListPeer> mWhiteListedRanges;
p3ServiceControl *mServiceCtrl;
p3NetMgr *mNetMgr;
//p3NetMgr *mNetMgr;
time_t mLastDhtInfoRequest ;
bool mIPFilteringEnabled ;

View File

@ -1035,7 +1035,7 @@ bool p3GxsReputation::setOwnOpinion(const RsGxsId& gxsid, const RsReputations::O
if (rit == mReputations.end())
{
#warning we should set the owner node id here.
#warning csoler 2017-01-05: We should set the owner node id here.
mReputations[gxsid] = Reputation(gxsid);
rit = mReputations.find(gxsid);
}

View File

@ -174,7 +174,7 @@ private:
time_t mLastIdentityFlagsUpdate ;
bool mReputationsUpdated;
float mAutoBanIdentitiesLimit ;
//float mAutoBanIdentitiesLimit ;
bool mAutoSetPositiveOptionToContacts;
p3LinkMgr *mLinkMgr;

View File

@ -788,7 +788,7 @@ bool p3IdService::createIdentity(uint32_t& token, RsIdentityParameters &params)
if (params.isPgpLinked)
{
#warning Backward compatibility issue to fix here in v0.7.0
#warning csoler 2017-02-07: Backward compatibility issue to fix here in v0.7.0
// This is a hack, because a bad decision led to having RSGXSID_GROUPFLAG_REALID be equal to GXS_SERV::FLAG_PRIVACY_PRIVATE.
// In order to keep backward compatibility, we'll also add the new value

View File

@ -93,7 +93,7 @@ again:
idx = (idx + 1) % 4;
}
idx = idx;
//idx = idx;
return buf ;
}

View File

@ -2394,7 +2394,7 @@ static int parse_secret_key(ops_region_t *region,ops_parse_info_t *pinfo)
else if(C.secret_key.s2k_usage != OPS_S2KU_NONE)
{
// this is V3 style, looks just like a V4 simple hash
C.secret_key.algorithm=C.secret_key.s2k_usage;
C.secret_key.algorithm=(ops_symmetric_algorithm_t)C.secret_key.s2k_usage;
C.secret_key.s2k_usage=OPS_S2KU_ENCRYPTED;
C.secret_key.s2k_specifier=OPS_S2KS_SIMPLE;
C.secret_key.hash_algorithm=OPS_HASH_MD5;

View File

@ -651,7 +651,7 @@ static time_t parseRFC822Date(const std::string &pubDate)
offset = abs(offset);
offset = ((offset / 100)*60 + (offset % 100))*sgn;
} else {
for (int i=0; known_zones[i].tzName != 0; i++) {
for (int i=0; known_zones[i].tzName[0] != 0; i++) {
if (0 == strncasecmp(dateString, known_zones[i].tzName, strlen(known_zones[i].tzName))) {
offset = known_zones[i].tzOffset;
break;

View File

@ -66,7 +66,9 @@ private:
AVPacket decoding_buffer;
uint64_t encoding_frame_count ;
#ifdef DEBUG_MPEG_VIDEO
FILE *encoding_debug_file ;
#endif
};
// This class decodes video from a stream. It keeps a queue of

View File

@ -1208,6 +1208,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint )
contextMnu.exec(QCursor::pos());
}
#ifdef SUSPENDED
static void set_item_background(QTreeWidgetItem *item, uint32_t type)
{
QBrush brush;
@ -1248,7 +1249,6 @@ static void update_children_background(QTreeWidgetItem *item, uint32_t type)
}
}
#ifdef SUSPENDED
static void set_tree_background(QTreeWidget *tree, uint32_t type)
{
std::cerr << "CirclesDialog set_tree_background()";
@ -1993,7 +1993,7 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
return tr("Membership verification in circle %1.").arg(QString::fromStdString(u.mGrpId.toStdString()));
}
#warning TODO! Add the different strings and translations here.
#warning TODO! csoler 2017-01-03: Add the different strings and translations here.
default:
return QString("Undone yet");
}

View File

@ -287,7 +287,7 @@
<height>692</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="scrollAreaWidgetContentsVLayout">
<item>
<widget class="QFrame" name="headerFramePerson">
<property name="frameShape">
@ -296,12 +296,12 @@
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<layout class="QGridLayout" name="headerFramePersonGLayout">
<property name="horizontalSpacing">
<number>12</number>
</property>
<item row="0" column="3">
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="headerFramePersonVLayout">
<item>
<widget class="StyledElidedLabel" name="headerTextLabel_Person">
<property name="text">
@ -397,7 +397,7 @@
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<layout class="QHBoxLayout" name="distantFrameHLayout">
<layout class="QHBoxLayout" name="inviteFrameHLayout">
<property name="leftMargin">
<number>6</number>
</property>
@ -514,7 +514,7 @@ border-image: url(:/images/closepressed.png)
<property name="title">
<string>Identity info</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<layout class="QGridLayout" name="detailsGroupBoxGLayout">
<item row="10" column="1">
<widget class="QLineEdit" name="neighborNodesOpinion_TF">
<property name="toolTip">
@ -526,7 +526,7 @@ border-image: url(:/images/closepressed.png)
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="label_YourOpinion">
<property name="text">
<string>Your opinion:</string>
</property>
@ -540,7 +540,7 @@ border-image: url(:/images/closepressed.png)
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="Line" name="line">
<widget class="Line" name="line_IdInfo">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -728,7 +728,7 @@ p, li { white-space: pre-wrap; }
<widget class="QLineEdit" name="lineEdit_LastUsed"/>
</item>
<item row="1" column="2" rowspan="11">
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="avatarGLayout">
<item row="0" column="0">
<widget class="QLabel" name="avatarLabel">
<property name="sizePolicy">
@ -774,12 +774,12 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QHBoxLayout" name="avatarOpinionHLayout">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="label_PosIcon">
<property name="maximumSize">
<size>
<width>34</width>
@ -813,14 +813,14 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<widget class="Line" name="line_Opinion">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="label_NegIcon">
<property name="maximumSize">
<size>
<width>34</width>
@ -856,7 +856,7 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item row="3" column="0">
<spacer name="avatarVSpacer_2">
<spacer name="avatarVSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -874,11 +874,11 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="usageStatisticsGBox">
<property name="title">
<string>Usage statistics</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="usageStatisticsGBoxHLayout">
<item>
<widget class="RSTextBrowser" name="usageStatistics_TB"/>
</item>
@ -886,7 +886,7 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<spacer name="scrollAreaWidgetContentsVSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -900,10 +900,8 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
<zorder>detailsGroupBox</zorder>
<zorder>detailsGroupBox</zorder>
<zorder>groupBox</zorder>
<zorder>usageStatisticsGBox</zorder>
<zorder>headerFramePerson</zorder>
<zorder>verticalSpacer_2</zorder>
</widget>
</widget>
</item>

View File

@ -1207,7 +1207,7 @@ void MainWindow::showHelpDialog(const QString &topic)
void
MainWindow::retranslateUi()
{
retranslateUi();
//retranslateUi();
foreach (MainPage *page, ui->stackPages->pages()) {
page->retranslateUi();
}

View File

@ -96,7 +96,7 @@ void CircleWidget::updateData(const RsGroupMetaData& gxs_group_info
}
}
QSize CircleWidget::sizeHint()
QSize CircleWidget::sizeHint() const
{
QSize size;
size.setHeight(ui->graphicsView->size().height() + ui->label->size().height());

View File

@ -24,7 +24,7 @@ public:
, const RsGxsCircleDetails& details);
//Start QWidget Properties
QSize sizeHint();
QSize sizeHint() const;
//Start FlowLayoutItem Properties
virtual const QPixmap getImage();
virtual const QPixmap getDragImage();

View File

@ -148,7 +148,7 @@ void IdentityWidget::updateData(const RsGxsIdGroup &gxs_group_info, const RsPeer
updateData(pgp_details);
}
QSize IdentityWidget::sizeHint()
QSize IdentityWidget::sizeHint() const
{
QSize size;
size.setHeight(ui->graphicsView->size().height() + ui->labelName->size().height());

View File

@ -26,7 +26,7 @@ public:
, const RsPeerDetails& pgp_details);
//Start QWidget Properties
QSize sizeHint();
QSize sizeHint() const;
//Start FlowLayoutItem Properties
virtual const QPixmap getImage();
virtual const QPixmap getDragImage();

View File

@ -901,7 +901,7 @@ void PeopleDialog::pf_dropEventOccursExt(QDropEvent *event)
QWidget *wid =
qobject_cast<QWidget *>(event->source());//QT5 return QObject
FlowLayout *layout;
FlowLayout *layout = NULL;
if (wid) layout =
qobject_cast<FlowLayout *>(wid->layout());
if (layout) {
@ -991,7 +991,7 @@ void PeopleDialog::pf_dropEventOccursInt(QDropEvent *event)
QWidget *wid =
qobject_cast<QWidget *>(event->source());//QT5 return QObject
FlowLayout *layout;
FlowLayout *layout = NULL;
if (wid) layout =
qobject_cast<FlowLayout *>(wid->layout());
if (layout) {

View File

@ -77,7 +77,7 @@ class RetroShareLink
RetroShareLink(const QUrl& url);
RetroShareLink(const QString& url);
#warning these methods should be static and return a created link
#warning csoler 2017-01-04: These methods should be static and return a created link
bool createFile(const QString& name, uint64_t size, const QString& hash);
bool createExtraFile(const QString& name, uint64_t size, const QString& hash, const QString& ssl_id);
bool createPerson(const RsPgpId &id);

View File

@ -63,7 +63,7 @@ void ChatDialog::closeEvent(QCloseEvent *event)
emit dialogClose(this);
}
void ChatDialog::init(ChatId id, const QString &title)
void ChatDialog::init(const ChatId &id, const QString &title)
{
mChatId = id;
ChatWidget *cw = getChatWidget();
@ -102,14 +102,14 @@ void ChatDialog::init(ChatId id, const QString &title)
if (chatflags & RS_CHAT_OPEN) {
if (id.isLobbyId()) {
ChatLobbyDialog* cld = new ChatLobbyDialog(id.toLobbyId());
cld->init();
cld->init(ChatId(), "");
cd = cld;
}
else if(id.isDistantChatId())
{
PopupDistantChatDialog* pdcd = new PopupDistantChatDialog(id.toDistantChatId());
pdcd->init(id.toDistantChatId());
pdcd->init(id, "");
cd = pdcd;
}
else

View File

@ -84,7 +84,7 @@ protected:
virtual QString getPeerName(const ChatId &sslid) const ; // can be overloaded for chat dialogs that have specific peers
virtual QString getOwnName() const;
virtual void init(ChatId id, const QString &title);
virtual void init(const ChatId &id, const QString &title);
virtual void addChatMsg(const ChatMessage& msg) = 0;
ChatId mChatId;

View File

@ -304,7 +304,7 @@ void ChatLobbyDialog::showInPeopleTab()
idDialog->navigate(nickname);
}
void ChatLobbyDialog::init()
void ChatLobbyDialog::init(const ChatId &/*id*/, const QString &/*title*/)
{
ChatLobbyInfo linfo ;

View File

@ -71,7 +71,7 @@ protected:
virtual ~ChatLobbyDialog();
void processSettings(bool load);
virtual void init();
virtual void init(const ChatId &id, const QString &title);
virtual bool canClose();
virtual void addChatMsg(const ChatMessage &msg);

View File

@ -76,7 +76,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
int iconHeight = FMM*QFontMetricsF(font()).height() ;
QSize iconSize = QSize(iconHeight,iconHeight);
QSize buttonSize = QSize(iconSize + QSize(FMM,FMM));
QSize buttonSize = QSize(iconSize + QSize((int)FMM,(int)FMM));
newMessages = false;
typing = false;
@ -258,7 +258,7 @@ void ChatWidget::addChatBarWidget(QWidget *w)
{
int iconHeight = FMM*QFontMetricsF(font()).height() ;
QSize iconSize = QSize(iconHeight,iconHeight);
QSize buttonSize = QSize(iconSize + QSize(FMM,FMM));
QSize buttonSize = QSize(iconSize + QSize((int)FMM,(int)FMM));
w->setFixedSize(buttonSize);
ui->pluginButtonFrame->layout()->addWidget(w) ;
}

View File

@ -63,9 +63,12 @@ PopupDistantChatDialog::PopupDistantChatDialog(const DistantChatPeerId& tunnel_i
updateDisplay() ;
}
void PopupDistantChatDialog::init(const DistantChatPeerId &peer_id)
void PopupDistantChatDialog::init(const ChatId &chat_id, const QString &/*title*/)
{
_tunnel_id = peer_id;
if (!chat_id.isDistantChatId())
return;
_tunnel_id = chat_id.toDistantChatId();
DistantChatPeerInfo tinfo;
if(!rsMsgs->getDistantChatStatus(_tunnel_id,tinfo))
@ -74,15 +77,15 @@ void PopupDistantChatDialog::init(const DistantChatPeerId &peer_id)
RsIdentityDetails iddetails ;
if(rsIdentity->getIdDetails(tinfo.to_id,iddetails))
PopupChatDialog::init(ChatId(peer_id), QString::fromUtf8(iddetails.mNickname.c_str())) ;
PopupChatDialog::init(chat_id, QString::fromUtf8(iddetails.mNickname.c_str())) ;
else
PopupChatDialog::init(ChatId(peer_id), QString::fromStdString(tinfo.to_id.toStdString())) ;
PopupChatDialog::init(chat_id, QString::fromStdString(tinfo.to_id.toStdString())) ;
// Do not use setOwnId, because we don't want the user to change the GXS avatar from the chat window
// it will not be transmitted.
ui.ownAvatarWidget->setOwnId() ; // sets the flag
ui.ownAvatarWidget->setId(ChatId(peer_id)) ; // sets the actual Id
ui.ownAvatarWidget->setId(chat_id) ; // sets the actual Id
}
void PopupDistantChatDialog::updateDisplay()

View File

@ -38,7 +38,7 @@ class PopupDistantChatDialog: public PopupChatDialog
/** Default destructor */
virtual ~PopupDistantChatDialog();
virtual void init(const DistantChatPeerId& peer_id);
virtual void init(const ChatId& chat_id, const QString &title);
virtual void closeEvent(QCloseEvent *e) ;
virtual QString getPeerName(const ChatId &id) const ;

View File

@ -46,7 +46,7 @@
#include <math.h>
static const double Pi = 3.14159265358979323846264338327950288419717;
//static const double Pi = 3.14159265358979323846264338327950288419717;
Edge::Edge(Node *sourceNode, Node *destNode)
: arrowSize(10)

View File

@ -362,7 +362,7 @@ void GraphWidget::timerEvent(QTimerEvent *event)
bool itemsMoved = false;
foreach (Node *node, _nodes)
if(node->advance())
if(node->progress())
itemsMoved = true;
if (!itemsMoved) {

View File

@ -215,7 +215,7 @@ void Node::calculateForces(const double *map,int width,int height,int W,int H,fl
newPos.setY(qMin(qMax(newPos.y(), sceneRect.top()) , sceneRect.bottom()));
}
bool Node::advance()
bool Node::progress()
{
if(_type == GraphWidget::ELASTIC_NODE_TYPE_OWN)
return false;

View File

@ -77,7 +77,7 @@ public:
std::string descString() const { return _desc_string ; }
void calculateForces(const double *data,int width,int height,int W,int H,float x,float y,float speedf);
bool advance();
bool progress();
QRectF boundingRect() const;
QPainterPath shape() const;

View File

@ -1607,7 +1607,7 @@ void GxsForumThreadWidget::insertMessage()
int current_index = 0 ;
for(uint32_t i=0;i<(*it).size();++i)
for(int i=0;i<(*it).size();++i)
{
ui->versions_CB->insertItem(i, ((i==0)?tr("(Latest) "):tr("(Old) "))+" "+DateTime::formatLongDateTime( (*it)[i].first));
ui->versions_CB->setItemData(i,QString::fromStdString((*it)[i].second.toStdString()));

View File

@ -379,7 +379,7 @@ void GlobalRouterStatisticsWidget::updateContent()
painter.setPen(QColor::fromRgb(0,0,0)) ;
painter.setPen(QColor::fromRgb(0.5,0.5,0.5));
painter.setPen(QColor::fromRgb(127,127,127));
painter.drawRect(ox+2*cellx,current_oy+0.15*celly,fm_monospace.width(ids)+cellx*matrix_info.friend_ids.size()- 2*cellx,celly) ;
float total_length = (matrix_info.friend_ids.size()+2)*cellx ;