mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-13 01:44:29 -05:00
corrected bug in rsdiscitem that prevented RsDiscReply packets to transfer cp serialiser/rsdiscitems.cc ../../../../trunk/libretroshare/src/serialiser/rsdiscitems.cc
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@3084 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
15f5f1f359
commit
737a4d0917
@ -36,6 +36,7 @@
|
|||||||
/***
|
/***
|
||||||
#define RSSERIAL_DEBUG 1
|
#define RSSERIAL_DEBUG 1
|
||||||
***/
|
***/
|
||||||
|
#define RSSERIAL_DEBUG 1
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
@ -346,8 +347,11 @@ bool RsDiscSerialiser::serialiseReply(RsDiscReply *item, void *data, uint32_
|
|||||||
|
|
||||||
for (pitemIt = item->rsPeerList.begin(); pitemIt!=(item->rsPeerList.end()) && ok; ++pitemIt)
|
for (pitemIt = item->rsPeerList.begin(); pitemIt!=(item->rsPeerList.end()) && ok; ++pitemIt)
|
||||||
{
|
{
|
||||||
uint32_t size = 0;
|
uint32_t size = ~(uint32_t)0; // we must be conservative otherwise the serialiser returns false !!
|
||||||
|
|
||||||
ok &= rss.serialise(&(*pitemIt), (void *) (((char *) data) + offset), &size);
|
ok &= rss.serialise(&(*pitemIt), (void *) (((char *) data) + offset), &size);
|
||||||
|
|
||||||
|
// The size has been updated to its exact value.
|
||||||
offset += size;
|
offset += size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,7 +359,7 @@ bool RsDiscSerialiser::serialiseReply(RsDiscReply *item, void *data, uint32_
|
|||||||
{
|
{
|
||||||
ok = false;
|
ok = false;
|
||||||
#ifdef RSSERIAL_DEBUG
|
#ifdef RSSERIAL_DEBUG
|
||||||
std::cerr << "RsDiscSerialiser::serialiseReply() Size Error! " << std::endl;
|
std::cerr << "RsDiscSerialiser::serialiseReply() Size Error: " << tlvsize << " != " << offset << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user