[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 34/75: complain if datacache returns expired value
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 34/75: complain if datacache returns expired values |
Date: |
Thu, 09 Aug 2018 23:58:31 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit ae8b5cb2eac770be0d18b7d46c238bf865e34023
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Jun 12 11:09:50 2018 +0200
complain if datacache returns expired values
---
src/dht/gnunet-service-dht_datacache.c | 5 +++++
src/gns/gnunet-service-gns_resolver.c | 16 +++++++++++++++-
src/gnsrecord/gnsrecord_crypto.c | 12 ++++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/src/dht/gnunet-service-dht_datacache.c
b/src/dht/gnunet-service-dht_datacache.c
index 1f01387ff..7ad9aa728 100644
--- a/src/dht/gnunet-service-dht_datacache.c
+++ b/src/dht/gnunet-service-dht_datacache.c
@@ -171,6 +171,11 @@ datacache_get_iterator (void *cls,
struct GetRequestContext *ctx = cls;
enum GNUNET_BLOCK_EvaluationResult eval;
+ if (0 == GNUNET_TIME_absolute_get_remaining (exp).rel_value_us)
+ {
+ GNUNET_break (0); /* why does datacache return expired values? */
+ return GNUNET_OK; /* skip expired record */
+ }
if ( (NULL == data) &&
(0 == data_size) )
data = &non_null; /* point anywhere, but not to NULL */
diff --git a/src/gns/gnunet-service-gns_resolver.c
b/src/gns/gnunet-service-gns_resolver.c
index a90cc4c0e..54c3cba23 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -1377,6 +1377,10 @@ vpn_allocation_cb (void *cls,
}
}
GNUNET_assert (i < vpn_ctx->rd_count);
+ if (0 == vpn_ctx->rd_count)
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ _("VPN returned empty result for `%s'\n"),
+ rh->name);
handle_gns_resolution_result (rh,
vpn_ctx->rd_count,
rd);
@@ -1859,7 +1863,8 @@ handle_gns_resolution_result (void *cls,
if (0 == rd_count)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _("GNS lookup failed (zero records found)\n"));
+ _("GNS lookup failed (zero records found for `%s')\n"),
+ rh->name);
fail_resolution (rh);
return;
}
@@ -2370,6 +2375,11 @@ handle_dht_response (void *cls,
fail_resolution (rh);
return;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Decrypting DHT block of size %u for `%s', expires %s\n",
+ ntohl (block->purpose.size),
+ rh->name,
+ GNUNET_STRINGS_absolute_time_to_string (exp));
if (GNUNET_OK !=
GNUNET_GNSRECORD_block_decrypt (block,
&ac->authority_info.gns_authority,
@@ -2450,6 +2460,10 @@ handle_gns_namecache_resolution_result (void *cls,
{
struct GNS_ResolverHandle *rh = cls;
+ if (0 == rd_count)
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ _("GNS namecache returned empty result for `%s'\n"),
+ rh->name);
handle_gns_resolution_result (rh,
rd_count,
rd);
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c
index 0752086fe..295d31100 100644
--- a/src/gnsrecord/gnsrecord_crypto.c
+++ b/src/gnsrecord/gnsrecord_crypto.c
@@ -377,6 +377,8 @@ GNUNET_GNSRECORD_block_decrypt (const struct
GNUNET_GNSRECORD_Block *block,
(0 == (rd[k].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) )
{
include_record = GNUNET_NO; /* We have a non-expired, non-shadow
record of the same type */
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Ignoring shadow record\n");
break;
}
}
@@ -395,6 +397,16 @@ GNUNET_GNSRECORD_block_decrypt (const struct
GNUNET_GNSRECORD_Block *block,
rd[j] = rd[i];
j++;
}
+ else
+ {
+ struct GNUNET_TIME_Absolute at;
+
+ at.abs_value_us = rd[i].expiration_time;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Excluding record that expired %s (%llu ago)\n",
+ GNUNET_STRINGS_absolute_time_to_string (at),
+ (unsigned long long) rd[i].expiration_time -
now.abs_value_us);
+ }
}
rd_count = j;
if (NULL != proc)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] 22/75: fix the stupid, (continued)
- [GNUnet-SVN] [gnunet] 22/75: fix the stupid, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 11/75: README rework part 1, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 29/75: Fix the link to the preliminary documentation, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 23/75: config: file name expansion in all -f cases, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 26/75: doc: create system specific folder and move files into it, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 25/75: rps profiler: add correct make rule, util, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 37/75: ensure DHT never accepts or passes along expired blocks, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 39/75: rps profiler: cleaned debug output, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 30/75: remove crypto_bug.c, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 28/75: README: Mention further reading material, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 34/75: complain if datacache returns expired values,
gnunet <=
- [GNUnet-SVN] [gnunet] 21/75: avoid looping on listing of zone, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 31/75: -wip error gns, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 36/75: tell mysql that our integers are unsigned, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 40/75: doc: Add new files to Makefile., gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 38/75: rps profiler: generate output for randomness tests, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 45/75: fix, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 41/75: some changes and work in user handbook., gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 46/75: mariadb, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 51/75: -Merge branch 'master' of ssh://gnunet.org/gnunet into gsoc2018/rest_api, gnunet, 2018/08/09
- [GNUnet-SVN] [gnunet] 47/75: remove dead file, gnunet, 2018/08/09