aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-service-namestore.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-04 07:22:37 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-04 07:22:37 +0000
commit900b48c3aa80d693fd79b6ef9a3dce323ac61a57 (patch)
tree13ec8dc7d0081ba459631196613a93142814941d /src/namestore/gnunet-service-namestore.c
parent4c297e9d83087fef43bb3c6cb89b8787b5d7bdc9 (diff)
downloadgnunet-900b48c3aa80d693fd79b6ef9a3dce323ac61a57.tar.gz
gnunet-900b48c3aa80d693fd79b6ef9a3dce323ac61a57.zip
-do set expiration time when storing records, works better that way...
Diffstat (limited to 'src/namestore/gnunet-service-namestore.c')
-rw-r--r--src/namestore/gnunet-service-namestore.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 7ca043d8a..8251a41fa 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -372,8 +372,9 @@ handle_lookup_block_it (void *cls,
372 r->derived_key = block->derived_key; 372 r->derived_key = block->derived_key;
373 memcpy (&r[1], &block[1], esize); 373 memcpy (&r[1], &block[1], esize);
374 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 374 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
375 "Sending `%s' message\n", 375 "Sending `%s' message with expiration time %s\n",
376 "NAMESTORE_LOOKUP_BLOCK_RESPONSE"); 376 "NAMESTORE_LOOKUP_BLOCK_RESPONSE",
377 GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_ntoh (r->expire)));
377 GNUNET_SERVER_notification_context_unicast (snc, 378 GNUNET_SERVER_notification_context_unicast (snc,
378 lnc->nc->client, 379 lnc->nc->client,
379 &r->gns_header.header, 380 &r->gns_header.header,
@@ -458,9 +459,6 @@ handle_block_cache (void *cls,
458 size_t esize; 459 size_t esize;
459 int res; 460 int res;
460 461
461 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
462 "Received `%s' message\n",
463 "NAMESTORE_BLOCK_CACHE");
464 nc = client_lookup (client); 462 nc = client_lookup (client);
465 if (ntohs (message->size) < sizeof (struct BlockCacheMessage)) 463 if (ntohs (message->size) < sizeof (struct BlockCacheMessage))
466 { 464 {
@@ -477,6 +475,10 @@ handle_block_cache (void *cls,
477 sizeof (struct GNUNET_TIME_AbsoluteNBO) + 475 sizeof (struct GNUNET_TIME_AbsoluteNBO) +
478 esize); 476 esize);
479 block->expiration_time = rp_msg->expire; 477 block->expiration_time = rp_msg->expire;
478 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
479 "Received `%s' message with expiration time %s\n",
480 "NAMESTORE_BLOCK_CACHE",
481 GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_ntoh (block->expiration_time)));
480 memcpy (&block[1], &rp_msg[1], esize); 482 memcpy (&block[1], &rp_msg[1], esize);
481 res = GSN_database->cache_block (GSN_database->cls, 483 res = GSN_database->cache_block (GSN_database->cls,
482 block); 484 block);