- test and log for bug #0003423
[oweals/gnunet.git] / src / gnsrecord / gnsrecord_serialization.c
index 0fd10b3e04211815f592bc35cb4c0b70c26487ab..0c70ad24687aed6cc6b51b48fa6e926b8dc6fcf5 100644 (file)
@@ -77,12 +77,12 @@ GNUNET_NETWORK_STRUCT_END
  * records.
  *
  * @param rd_count number of records in the rd array
- * @param rd array of #GNUNET_NAMESTORE_RecordData with @a rd_count elements
+ * @param rd array of #GNUNET_GNSRECORD_Data with @a rd_count elements
  * @return the required size to serialize
  */
 size_t
-GNUNET_NAMESTORE_records_get_size (unsigned int rd_count,
-                                  const struct GNUNET_NAMESTORE_RecordData *rd)
+GNUNET_GNSRECORD_records_get_size (unsigned int rd_count,
+                                  const struct GNUNET_GNSRECORD_Data *rd)
 {
   unsigned int i;
   size_t ret;
@@ -101,14 +101,14 @@ GNUNET_NAMESTORE_records_get_size (unsigned int rd_count,
  * Serialize the given records to the given destination buffer.
  *
  * @param rd_count number of records in the rd array
- * @param rd array of #GNUNET_NAMESTORE_RecordData with @a rd_count elements
+ * @param rd array of #GNUNET_GNSRECORD_Data with @a rd_count elements
  * @param dest_size size of the destination array
  * @param dest where to write the result
  * @return the size of serialized records, -1 if records do not fit
  */
 ssize_t
-GNUNET_NAMESTORE_records_serialize (unsigned int rd_count,
-                                   const struct GNUNET_NAMESTORE_RecordData *rd,
+GNUNET_GNSRECORD_records_serialize (unsigned int rd_count,
+                                   const struct GNUNET_GNSRECORD_Data *rd,
                                    size_t dest_size,
                                    char *dest)
 {
@@ -119,11 +119,13 @@ GNUNET_NAMESTORE_records_serialize (unsigned int rd_count,
   off = 0;
   for (i=0;i<rd_count;i++)
   {
+#if 0
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Serializing record %u with flags %d and expiration time %llu\n",
          i,
          rd[i].flags,
          (unsigned long long) rd[i].expiration_time);
+#endif
     rec.expiration_time = GNUNET_htonll (rd[i].expiration_time);
     rec.data_size = htonl ((uint32_t) rd[i].data_size);
     rec.record_type = htonl (rd[i].record_type);
@@ -151,10 +153,10 @@ GNUNET_NAMESTORE_records_serialize (unsigned int rd_count,
  * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 int
-GNUNET_NAMESTORE_records_deserialize (size_t len,
+GNUNET_GNSRECORD_records_deserialize (size_t len,
                                      const char *src,
                                      unsigned int rd_count,
-                                     struct GNUNET_NAMESTORE_RecordData *dest)
+                                     struct GNUNET_GNSRECORD_Data *dest)
 {
   struct NetworkRecord rec;
   unsigned int i;
@@ -175,11 +177,13 @@ GNUNET_NAMESTORE_records_deserialize (size_t len,
       return GNUNET_SYSERR;
     dest[i].data = &src[off];
     off += dest[i].data_size;
+#if 0
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Deserialized record %u with flags %d and expiration time %llu\n",
          i,
          dest[i].flags,
          (unsigned long long) dest[i].expiration_time);
+#endif
   }
   return GNUNET_OK;
 }