diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-02-08 00:29:47 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-02-08 00:29:47 +0100 |
commit | fab89196f0a3a14b8d1e3de593958b78f6d58775 (patch) | |
tree | 26672a891427ec5550e70081535e2fa51f7b9316 /src/gnsrecord | |
parent | 801b48edcf34f571b7ad7f99269ae683a1497a02 (diff) | |
download | gnunet-fab89196f0a3a14b8d1e3de593958b78f6d58775.tar.gz gnunet-fab89196f0a3a14b8d1e3de593958b78f6d58775.zip |
-fix namestore logic
Diffstat (limited to 'src/gnsrecord')
-rw-r--r-- | src/gnsrecord/gnsrecord_misc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c index c4a39a33d..9b5e47c4c 100644 --- a/src/gnsrecord/gnsrecord_misc.c +++ b/src/gnsrecord/gnsrecord_misc.c | |||
@@ -156,8 +156,8 @@ GNUNET_GNSRECORD_record_get_expiration_time (unsigned int rd_count, | |||
156 | struct GNUNET_TIME_Absolute at_shadow; | 156 | struct GNUNET_TIME_Absolute at_shadow; |
157 | struct GNUNET_TIME_Relative rt_shadow; | 157 | struct GNUNET_TIME_Relative rt_shadow; |
158 | 158 | ||
159 | if (NULL == rd) | 159 | if (0 == rd_count) |
160 | return GNUNET_TIME_UNIT_ZERO_ABS; | 160 | return GNUNET_TIME_absolute_max (GNUNET_TIME_UNIT_ZERO_ABS, min); |
161 | expire = GNUNET_TIME_UNIT_FOREVER_ABS; | 161 | expire = GNUNET_TIME_UNIT_FOREVER_ABS; |
162 | for (unsigned int c = 0; c < rd_count; c++) | 162 | for (unsigned int c = 0; c < rd_count; c++) |
163 | { | 163 | { |
@@ -194,7 +194,7 @@ GNUNET_GNSRECORD_record_get_expiration_time (unsigned int rd_count, | |||
194 | expire = GNUNET_TIME_absolute_min (at, | 194 | expire = GNUNET_TIME_absolute_min (at, |
195 | expire); | 195 | expire); |
196 | } | 196 | } |
197 | expire = GNUNET_TIME_absolute_min (expire, min); | 197 | expire = GNUNET_TIME_absolute_max (expire, min); |
198 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 198 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
199 | "Determined expiration time for block with %u records to be %s\n", | 199 | "Determined expiration time for block with %u records to be %s\n", |
200 | rd_count, | 200 | rd_count, |
@@ -422,7 +422,7 @@ GNUNET_GNSRECORD_normalize_record_set (const char *label, | |||
422 | int have_empty_label = (0 == strcmp (GNUNET_GNS_EMPTY_LABEL_AT, label)); | 422 | int have_empty_label = (0 == strcmp (GNUNET_GNS_EMPTY_LABEL_AT, label)); |
423 | unsigned int rd_count_tmp; | 423 | unsigned int rd_count_tmp; |
424 | 424 | ||
425 | minimum_expiration = GNUNET_TIME_UNIT_FOREVER_ABS; | 425 | minimum_expiration = GNUNET_TIME_UNIT_ZERO_ABS; |
426 | now = GNUNET_TIME_absolute_get (); | 426 | now = GNUNET_TIME_absolute_get (); |
427 | rd_count_tmp = 0; | 427 | rd_count_tmp = 0; |
428 | for (unsigned int i = 0; i < rd_count; i++) | 428 | for (unsigned int i = 0; i < rd_count; i++) |
@@ -498,7 +498,7 @@ GNUNET_GNSRECORD_normalize_record_set (const char *label, | |||
498 | if (have_empty_label) | 498 | if (have_empty_label) |
499 | { | 499 | { |
500 | *emsg = GNUNET_strdup (_ ( | 500 | *emsg = GNUNET_strdup (_ ( |
501 | "Redirection records not allowed in apex..\n")); | 501 | "Redirection records not allowed in apex..")); |
502 | return GNUNET_SYSERR; | 502 | return GNUNET_SYSERR; |
503 | } | 503 | } |
504 | if ((GNUNET_YES == have_other) || | 504 | if ((GNUNET_YES == have_other) || |
@@ -520,7 +520,7 @@ GNUNET_GNSRECORD_normalize_record_set (const char *label, | |||
520 | (GNUNET_YES == have_gns2dns)) | 520 | (GNUNET_YES == have_gns2dns)) |
521 | { | 521 | { |
522 | *emsg = GNUNET_strdup (_ ( | 522 | *emsg = GNUNET_strdup (_ ( |
523 | "Mutually exclusive records.\n")); | 523 | "Mutually exclusive records.")); |
524 | return GNUNET_SYSERR; | 524 | return GNUNET_SYSERR; |
525 | } | 525 | } |
526 | have_other = GNUNET_YES; | 526 | have_other = GNUNET_YES; |