mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added test to prevent using twice the same config file; changed duplicate config file name causing deserialisation errors and loss of some config files; added printout of hex code for RsItems that fail deserialisation
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8075 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cb6860a08d
commit
ae0603a687
@ -175,7 +175,16 @@ void p3ConfigMgr::addConfiguration(std::string file, pqiConfig *conf)
|
|||||||
std::cerr << "\tIgnoring new filename " << filename;
|
std::cerr << "\tIgnoring new filename " << filename;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// also check that the filename is not already registered for another config
|
||||||
|
|
||||||
|
for(std::list<pqiConfig*>::const_iterator it = mConfigs.begin();it!= mConfigs.end();++it)
|
||||||
|
if( (*it)->filename == filename )
|
||||||
|
{
|
||||||
|
std::cerr << "!!!!!!!!!!! Trying to register a config for file \"" << filename << "\" that is already registered" << std::endl;
|
||||||
|
std::cerr << "!!!!!!!!!!! Please correct the code !" << std::endl;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
conf->setFilename(filename);
|
conf->setFilename(filename);
|
||||||
mConfigs.push_back(conf);
|
mConfigs.push_back(conf);
|
||||||
|
@ -1592,7 +1592,7 @@ int RsServer::StartupRetroShare()
|
|||||||
#ifdef ENABLE_GROUTER
|
#ifdef ENABLE_GROUTER
|
||||||
mConfigMgr->addConfiguration("grouter.cfg", gr);
|
mConfigMgr->addConfiguration("grouter.cfg", gr);
|
||||||
#endif
|
#endif
|
||||||
mConfigMgr->addConfiguration("identity.cfg", mGxsIdService);
|
mConfigMgr->addConfiguration("p3identity.cfg", mGxsIdService);
|
||||||
|
|
||||||
#ifdef RS_USE_BITDHT
|
#ifdef RS_USE_BITDHT
|
||||||
mConfigMgr->addConfiguration("bitdht.cfg", mBitDht);
|
mConfigMgr->addConfiguration("bitdht.cfg", mBitDht);
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "serialiser/rsserial.h"
|
#include "serialiser/rsserial.h"
|
||||||
#include "util/rsthreads.h"
|
#include "util/rsthreads.h"
|
||||||
#include "util/rsstring.h"
|
#include "util/rsstring.h"
|
||||||
|
#include "util/rsprint.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -424,7 +425,9 @@ RsItem * RsSerialiser::deserialise(void *data, uint32_t *size)
|
|||||||
std::cerr << "RsSerialiser::deserialise() ERROR Failed!";
|
std::cerr << "RsSerialiser::deserialise() ERROR Failed!";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
std::cerr << "RsSerialiser::deserialise() pkt_size: " << pkt_size << " vs *size: " << *size;
|
std::cerr << "RsSerialiser::deserialise() pkt_size: " << pkt_size << " vs *size: " << *size;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
RsItem *item2 = (it->second)->deserialise(data, &pkt_size);
|
||||||
|
|
||||||
uint32_t failedtype = getRsItemId(data);
|
uint32_t failedtype = getRsItemId(data);
|
||||||
std::cerr << "RsSerialiser::deserialise() FAILED PACKET Size: ";
|
std::cerr << "RsSerialiser::deserialise() FAILED PACKET Size: ";
|
||||||
@ -435,7 +438,8 @@ RsItem * RsSerialiser::deserialise(void *data, uint32_t *size)
|
|||||||
std::cerr << " Class: " << std::hex << (uint32_t) getRsItemClass(failedtype) << std::dec;
|
std::cerr << " Class: " << std::hex << (uint32_t) getRsItemClass(failedtype) << std::dec;
|
||||||
std::cerr << " Type: " << std::hex << (uint32_t) getRsItemType(failedtype) << std::dec;
|
std::cerr << " Type: " << std::hex << (uint32_t) getRsItemType(failedtype) << std::dec;
|
||||||
std::cerr << " SubType: " << std::hex << (uint32_t) getRsItemSubType(failedtype) << std::dec;
|
std::cerr << " SubType: " << std::hex << (uint32_t) getRsItemSubType(failedtype) << std::dec;
|
||||||
std::cerr << std::endl;
|
std::cerr << " Data: " << RsUtil::BinToHex((char*)data,pkt_size) << std::endl;
|
||||||
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -456,7 +460,8 @@ RsItem * RsSerialiser::deserialise(void *data, uint32_t *size)
|
|||||||
std::cerr << " Version: " << std::hex << (uint32_t) getRsItemVersion(failedtype) << std::dec;
|
std::cerr << " Version: " << std::hex << (uint32_t) getRsItemVersion(failedtype) << std::dec;
|
||||||
std::cerr << " Class: " << std::hex << (uint32_t) getRsItemClass(failedtype) << std::dec;
|
std::cerr << " Class: " << std::hex << (uint32_t) getRsItemClass(failedtype) << std::dec;
|
||||||
std::cerr << " Type: " << std::hex << (uint32_t) getRsItemType(failedtype) << std::dec;
|
std::cerr << " Type: " << std::hex << (uint32_t) getRsItemType(failedtype) << std::dec;
|
||||||
std::cerr << " SubType: " << std::hex << (uint32_t) getRsItemSubType(failedtype) << std::dec;
|
std::cerr << " SubType: " << std::hex << (uint32_t) getRsItemSubType(failedtype) << std::dec;
|
||||||
|
std::cerr << " Data: " << RsUtil::BinToHex((char*)data,pkt_size) << std::endl;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user