replace raw with tlv string functions for better visibility

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1664 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
alexandrut 2009-09-19 17:36:29 +00:00
parent 360f1b6c99
commit 4e4d0cb54a

View File

@ -644,8 +644,7 @@ std::ostream &RsDiscVersion::print(std::ostream &out, uint16_t indent)
uint32_t RsDiscSerialiser::sizeVersion(RsDiscVersion *item) uint32_t RsDiscSerialiser::sizeVersion(RsDiscVersion *item)
{ {
uint32_t s = 8; /* header */ uint32_t s = 8; /* header */
s += 4; /* size in RawString() */ s += GetTlvStringSize(item->version);
s += item->version.length();
return s; return s;
} }
@ -673,7 +672,7 @@ bool RsDiscSerialiser::serialiseVersion(RsDiscVersion *item, void *data, uint32_
/* skip the header */ /* skip the header */
offset += 8; offset += 8;
ok &= setRawString(data, tlvsize, &offset, item->version); ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_VALUE, item->version);
if (offset != tlvsize) if (offset != tlvsize)
{ {
@ -726,7 +725,7 @@ RsDiscVersion *RsDiscSerialiser::deserialiseVersion(void *data, uint32_t *pktsiz
/* skip the header */ /* skip the header */
offset += 8; offset += 8;
ok &= getRawString(data, rssize, &offset, item->version); ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_VALUE, item->version);
if (offset != rssize) if (offset != rssize)
{ {