mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-22 05:14:31 -04:00
Fix CppCheck in rsgenexchange.cc
/libretroshare/src/gxs/rsgenexchange.cc:2165: warning: Cppcheck(redundantAssignment): Variable 'serialOk' is reassigned a value before the old one has been used. /libretroshare/src/gxs/rsgenexchange.cc:1227: warning: Cppcheck(unusedVariable): Unused variable: metaL /libretroshare/src/gxs/rsgenexchange.cc:2254: warning: Cppcheck(unreadVariable): Variable 's' is assigned a value that is never used. /libretroshare/src/gxs/rsgenexchange.cc:71: warning: Cppcheck(uninitMemberVar): Member variable 'RsGenExchange::mCheckStarted' is not initialized in the constructor.
This commit is contained in:
parent
344bc27ff7
commit
eb7655c14f
1 changed files with 5 additions and 4 deletions
|
@ -82,6 +82,7 @@ RsGenExchange::RsGenExchange(RsGeneralDataService *gds, RsNetworkExchangeService
|
||||||
mLastClean((int)time(NULL) - (int)(RSRandom::random_u32() % MSG_CLEANUP_PERIOD)), // this helps unsynchronising the checks for the different services
|
mLastClean((int)time(NULL) - (int)(RSRandom::random_u32() % MSG_CLEANUP_PERIOD)), // this helps unsynchronising the checks for the different services
|
||||||
mMsgCleanUp(NULL),
|
mMsgCleanUp(NULL),
|
||||||
mChecking(false),
|
mChecking(false),
|
||||||
|
mCheckStarted(false),
|
||||||
mLastCheck((int)time(NULL) - (int)(RSRandom::random_u32() % INTEGRITY_CHECK_PERIOD) + 120), // this helps unsynchronising the checks for the different services, with 2 min security to avoid checking right away before statistics come up.
|
mLastCheck((int)time(NULL) - (int)(RSRandom::random_u32() % INTEGRITY_CHECK_PERIOD) + 120), // this helps unsynchronising the checks for the different services, with 2 min security to avoid checking right away before statistics come up.
|
||||||
mIntegrityCheck(NULL),
|
mIntegrityCheck(NULL),
|
||||||
SIGN_MAX_WAITING_TIME(60),
|
SIGN_MAX_WAITING_TIME(60),
|
||||||
|
@ -1234,7 +1235,7 @@ bool RsGenExchange::getMsgMeta(const uint32_t &token,
|
||||||
#ifdef GEN_EXCH_DEBUG
|
#ifdef GEN_EXCH_DEBUG
|
||||||
std::cerr << "RsGenExchange::getMsgMeta(): retrieving meta data for token " << token << std::endl;
|
std::cerr << "RsGenExchange::getMsgMeta(): retrieving meta data for token " << token << std::endl;
|
||||||
#endif
|
#endif
|
||||||
std::list<RsGxsMsgMetaData*> metaL;
|
//std::list<RsGxsMsgMetaData*> metaL;
|
||||||
GxsMsgMetaResult result;
|
GxsMsgMetaResult result;
|
||||||
bool ok = mDataAccess->getMsgSummary(token, result);
|
bool ok = mDataAccess->getMsgSummary(token, result);
|
||||||
|
|
||||||
|
@ -2168,15 +2169,13 @@ void RsGenExchange::publishMsgs()
|
||||||
uint32_t size = mSerialiser->size(msgItem);
|
uint32_t size = mSerialiser->size(msgItem);
|
||||||
char* mData = new char[size];
|
char* mData = new char[size];
|
||||||
|
|
||||||
bool serialOk = false;
|
|
||||||
|
|
||||||
// for fatal sign creation
|
// for fatal sign creation
|
||||||
bool createOk = false;
|
bool createOk = false;
|
||||||
|
|
||||||
// if sign requests to try later
|
// if sign requests to try later
|
||||||
bool tryLater = false;
|
bool tryLater = false;
|
||||||
|
|
||||||
serialOk = mSerialiser->serialise(msgItem, mData, &size);
|
bool serialOk = mSerialiser->serialise(msgItem, mData, &size);
|
||||||
|
|
||||||
if(serialOk)
|
if(serialOk)
|
||||||
{
|
{
|
||||||
|
@ -2266,6 +2265,8 @@ void RsGenExchange::publishMsgs()
|
||||||
char* metaDataBuff = new char[size];
|
char* metaDataBuff = new char[size];
|
||||||
bool s = msg->metaData->serialise(metaDataBuff, &size);
|
bool s = msg->metaData->serialise(metaDataBuff, &size);
|
||||||
s &= msg->meta.setBinData(metaDataBuff, size);
|
s &= msg->meta.setBinData(metaDataBuff, size);
|
||||||
|
if (!s)
|
||||||
|
std::cerr << "(WW) Can't serialise or set bin data" << std::endl;
|
||||||
|
|
||||||
msg->metaData->mMsgStatus = GXS_SERV::GXS_MSG_STATUS_UNPROCESSED;
|
msg->metaData->mMsgStatus = GXS_SERV::GXS_MSG_STATUS_UNPROCESSED;
|
||||||
msgId = msg->msgId;
|
msgId = msg->msgId;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue