From 079beb884ac4236f993736c664660c3892560c9b Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 6 Aug 2020 16:52:39 +0200 Subject: -fix serialization --- src/include/gnunet_reclaim_lib.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/include') diff --git a/src/include/gnunet_reclaim_lib.h b/src/include/gnunet_reclaim_lib.h index 4f2d6dba5..7d521ffa8 100644 --- a/src/include/gnunet_reclaim_lib.h +++ b/src/include/gnunet_reclaim_lib.h @@ -65,6 +65,7 @@ extern "C" { */ #define GNUNET_RECLAIM_ID_LENGTH (256 / 8) +GNUNET_NETWORK_STRUCT_BEGIN /** * A reclaim identifier * FIXME maybe put this in a different namespace @@ -74,6 +75,8 @@ struct GNUNET_RECLAIM_Identifier char id[GNUNET_RECLAIM_ID_LENGTH]; }; +GNUNET_NETWORK_STRUCT_END + static const struct GNUNET_RECLAIM_Identifier GNUNET_RECLAIM_ID_ZERO; #define GNUNET_RECLAIM_id_is_equal(a,b) ((0 == \ @@ -361,11 +364,13 @@ GNUNET_RECLAIM_attribute_serialize (const struct GNUNET_RECLAIM_Attribute *attr, * * @param data the serialized attribute * @param data_size the length of the serialized data + * @param attr deserialized attribute. Will be allocated. Must be free'd * - * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller + * @return number of bytes read or -1 for error */ -struct GNUNET_RECLAIM_Attribute * -GNUNET_RECLAIM_attribute_deserialize (const char *data, size_t data_size); +ssize_t +GNUNET_RECLAIM_attribute_deserialize (const char *data, size_t data_size, + struct GNUNET_RECLAIM_Attribute **attr); /** -- cgit v1.2.3