diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-14 22:31:38 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-15 12:11:19 +0200 |
commit | 25eb1fb2acbe92b418d8643c06107ce0ab2bfb9a (patch) | |
tree | 97ba1f700217697979449cec7528b4eab5e22a22 /src/namecache/plugin_namecache_flat.c | |
parent | 96c802b46be51e5c45f34e2de823f787d26c2929 (diff) | |
download | gnunet-25eb1fb2acbe92b418d8643c06107ce0ab2bfb9a.tar.gz gnunet-25eb1fb2acbe92b418d8643c06107ce0ab2bfb9a.zip |
- better wire format for rrblocks
Diffstat (limited to 'src/namecache/plugin_namecache_flat.c')
-rw-r--r-- | src/namecache/plugin_namecache_flat.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/namecache/plugin_namecache_flat.c b/src/namecache/plugin_namecache_flat.c index 1775561e1..eb7800051 100644 --- a/src/namecache/plugin_namecache_flat.c +++ b/src/namecache/plugin_namecache_flat.c | |||
@@ -207,10 +207,7 @@ store_and_free_entries (void *cls, | |||
207 | struct GNUNET_CRYPTO_HashAsciiEncoded query; | 207 | struct GNUNET_CRYPTO_HashAsciiEncoded query; |
208 | size_t block_size; | 208 | size_t block_size; |
209 | 209 | ||
210 | block_size = ntohl (entry->block->purpose.size) | 210 | block_size = GNUNET_GNSRECORD_block_get_size (entry->block); |
211 | + sizeof(struct GNUNET_IDENTITY_PublicKey) | ||
212 | + sizeof(struct GNUNET_CRYPTO_EcdsaSignature); | ||
213 | |||
214 | GNUNET_STRINGS_base64_encode ((char *) entry->block, | 211 | GNUNET_STRINGS_base64_encode ((char *) entry->block, |
215 | block_size, | 212 | block_size, |
216 | &block_b64); | 213 | &block_b64); |
@@ -277,7 +274,7 @@ expire_blocks (void *cls, | |||
277 | struct GNUNET_TIME_Absolute expiration; | 274 | struct GNUNET_TIME_Absolute expiration; |
278 | 275 | ||
279 | now = GNUNET_TIME_absolute_get (); | 276 | now = GNUNET_TIME_absolute_get (); |
280 | expiration = GNUNET_TIME_absolute_ntoh (entry->block->expiration_time); | 277 | expiration = GNUNET_GNSRECORD_block_get_expiration (entry->block); |
281 | 278 | ||
282 | if (0 == GNUNET_TIME_absolute_get_difference (now, | 279 | if (0 == GNUNET_TIME_absolute_get_difference (now, |
283 | expiration).rel_value_us) | 280 | expiration).rel_value_us) |
@@ -319,12 +316,9 @@ namecache_cache_block (void *cls, | |||
319 | size_t block_size; | 316 | size_t block_size; |
320 | 317 | ||
321 | namecache_expire_blocks (plugin); | 318 | namecache_expire_blocks (plugin); |
322 | GNUNET_CRYPTO_hash (&block->derived_key, | 319 | GNUNET_GNSRECORD_query_from_block (block, |
323 | sizeof(struct GNUNET_IDENTITY_PublicKey), | 320 | &query); |
324 | &query); | 321 | block_size = GNUNET_GNSRECORD_block_get_size (block); |
325 | block_size = ntohl (block->purpose.size) | ||
326 | + sizeof(struct GNUNET_IDENTITY_PublicKey) | ||
327 | + sizeof(struct GNUNET_CRYPTO_EcdsaSignature); | ||
328 | if (block_size > 64 * 65536) | 322 | if (block_size > 64 * 65536) |
329 | { | 323 | { |
330 | GNUNET_break (0); | 324 | GNUNET_break (0); |