diff options
-rw-r--r-- | src/gns/gnunet-service-gns.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index 6b4e63914..24e0668a9 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c | |||
@@ -22,10 +22,6 @@ | |||
22 | * @brief GNUnet GNS service | 22 | * @brief GNUnet GNS service |
23 | * @author Martin Schanzenbach | 23 | * @author Martin Schanzenbach |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | * | ||
26 | * TODO: | ||
27 | * - conversion of private to public records does NOT check if the | ||
28 | * records are actually public | ||
29 | */ | 25 | */ |
30 | #include "platform.h" | 26 | #include "platform.h" |
31 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
@@ -334,6 +330,9 @@ put_gns_record (void *cls, | |||
334 | struct GNUNET_HashCode query; | 330 | struct GNUNET_HashCode query; |
335 | struct GNUNET_TIME_Absolute expire; | 331 | struct GNUNET_TIME_Absolute expire; |
336 | size_t block_size; | 332 | size_t block_size; |
333 | struct GNUNET_NAMESTORE_RecordData rd_public[rd_count]; | ||
334 | unsigned int rd_public_count; | ||
335 | unsigned int i; | ||
337 | 336 | ||
338 | if (NULL == name) | 337 | if (NULL == name) |
339 | { | 338 | { |
@@ -385,22 +384,28 @@ put_gns_record (void *cls, | |||
385 | return; | 384 | return; |
386 | } | 385 | } |
387 | 386 | ||
388 | /* FIXME: filter out records that are not public! */ | 387 | /* filter out records that are not public! */ |
388 | rd_public_count = 0; | ||
389 | for (i=0;i<rd_count;i++) | ||
390 | if (0 == (rd[i].flags & (GNUNET_NAMESTORE_RF_PRIVATE | | ||
391 | GNUNET_NAMESTORE_RF_PENDING))) | ||
392 | rd_public[rd_public_count++] = rd[i]; | ||
393 | |||
389 | 394 | ||
390 | /* We got a set of records to publish */ | 395 | /* We got a set of records to publish */ |
391 | if (0 == rd_count) | 396 | if (0 == rd_public_count) |
392 | { | 397 | { |
393 | zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_next, | 398 | zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_next, |
394 | NULL); | 399 | NULL); |
395 | return; | 400 | return; |
396 | } | 401 | } |
397 | expire = GNUNET_NAMESTORE_record_get_expiration_time (rd_count, | 402 | expire = GNUNET_NAMESTORE_record_get_expiration_time (rd_public_count, |
398 | rd); | 403 | rd_public); |
399 | block = GNUNET_NAMESTORE_block_create (key, | 404 | block = GNUNET_NAMESTORE_block_create (key, |
400 | expire, | 405 | expire, |
401 | name, | 406 | name, |
402 | rd, | 407 | rd_public, |
403 | rd_count); | 408 | rd_public_count); |
404 | block_size = ntohl (block->purpose.size) | 409 | block_size = ntohl (block->purpose.size) |
405 | + sizeof (struct GNUNET_CRYPTO_EccSignature) | 410 | + sizeof (struct GNUNET_CRYPTO_EccSignature) |
406 | + sizeof (struct GNUNET_CRYPTO_EccPublicKey); | 411 | + sizeof (struct GNUNET_CRYPTO_EccPublicKey); |