mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-21 21:59:02 -04:00
fixed a few bugs in config items
This commit is contained in:
parent
fcabe6359f
commit
43b3b87782
3 changed files with 41 additions and 18 deletions
libretroshare/src/serialization
|
@ -1,3 +1,5 @@
|
|||
#include <typeinfo>
|
||||
|
||||
#include "util/rsprint.h"
|
||||
#include "serialization/rsserializer.h"
|
||||
#include "serialization/rstypeserializer.h"
|
||||
|
@ -14,7 +16,7 @@ RsItem *RsServiceSerializer::deserialise(void *data, uint32_t *size)
|
|||
|
||||
if(!item)
|
||||
{
|
||||
std::cerr << "(EE) cannot deserialise: unknown item type " << std::hex << rstype << std::dec << std::endl;
|
||||
std::cerr << "(EE) " << typeid(*this).name() << ": cannot deserialise unknown item subtype " << std::hex << getRsItemSubType(rstype) << std::dec << std::endl;
|
||||
std::cerr << "(EE) Data is: " << RsUtil::BinToHex(static_cast<uint8_t*>(data),std::min(50u,*size)) << ((*size>50)?"...":"") << std::endl;
|
||||
return NULL ;
|
||||
}
|
||||
|
@ -40,11 +42,11 @@ RsItem *RsConfigSerializer::deserialise(void *data, uint32_t *size)
|
|||
{
|
||||
uint32_t rstype = getRsItemId(const_cast<void*>((const void*)data)) ;
|
||||
|
||||
RsItem *item = create_item(getRsItemClass(rstype),getRsItemSubType(rstype)) ;
|
||||
RsItem *item = create_item(getRsItemType(rstype),getRsItemSubType(rstype)) ;
|
||||
|
||||
if(!item)
|
||||
{
|
||||
std::cerr << "(EE) cannot deserialise: unknown item type " << std::hex << rstype << std::dec << std::endl;
|
||||
std::cerr << "(EE) " << typeid(*this).name() << ": cannot deserialise unknown item subtype " << std::hex << getRsItemSubType(rstype) << std::dec << std::endl;
|
||||
std::cerr << "(EE) Data is: " << RsUtil::BinToHex(static_cast<uint8_t*>(data),std::min(50u,*size)) << ((*size>50)?"...":"") << std::endl;
|
||||
return NULL ;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue