diff options
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r-- | src/gns/gnunet-service-gns_resolver.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 2e96b60ea..bd9daf56e 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -888,8 +888,10 @@ dht_lookup_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
888 | char new_name[GNUNET_DNSPARSER_MAX_NAME_LENGTH]; | 888 | char new_name[GNUNET_DNSPARSER_MAX_NAME_LENGTH]; |
889 | 889 | ||
890 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 890 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
891 | "GNS_PHASE_REC-%llu: dht lookup for query %s (%llus) timed out.\n", | 891 | "GNS_PHASE_REC-%llu: dht lookup for query %s (%s) timed out.\n", |
892 | rh->id, rh->name, rh->timeout.rel_value); | 892 | rh->id, rh->name, |
893 | GNUNET_STRINGS_relative_time_to_string (rh->timeout, | ||
894 | GNUNET_YES)); | ||
893 | /** | 895 | /** |
894 | * Start resolution in bg | 896 | * Start resolution in bg |
895 | */ | 897 | */ |
@@ -1042,7 +1044,7 @@ process_record_result_dht (void* cls, | |||
1042 | 1044 | ||
1043 | namestore_bg_task->node = GNUNET_CONTAINER_heap_insert (ns_task_heap, | 1045 | namestore_bg_task->node = GNUNET_CONTAINER_heap_insert (ns_task_heap, |
1044 | namestore_bg_task, | 1046 | namestore_bg_task, |
1045 | GNUNET_TIME_absolute_get().abs_value); | 1047 | GNUNET_TIME_absolute_get().abs_value_us); |
1046 | if (0 < rh->answered) | 1048 | if (0 < rh->answered) |
1047 | rh->proc (rh->proc_cls, rh, num_records, rd); | 1049 | rh->proc (rh->proc_cls, rh, num_records, rd); |
1048 | else | 1050 | else |
@@ -1072,7 +1074,7 @@ resolve_record_dht (struct ResolverHandle *rh) | |||
1072 | 1074 | ||
1073 | rh->dht_heap_node = NULL; | 1075 | rh->dht_heap_node = NULL; |
1074 | 1076 | ||
1075 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value != rh->timeout.rel_value) | 1077 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != rh->timeout.rel_value_us) |
1076 | { | 1078 | { |
1077 | /** | 1079 | /** |
1078 | * Update timeout if necessary | 1080 | * Update timeout if necessary |
@@ -1114,7 +1116,7 @@ resolve_record_dht (struct ResolverHandle *rh) | |||
1114 | } | 1116 | } |
1115 | rh->dht_heap_node = GNUNET_CONTAINER_heap_insert (dht_lookup_heap, | 1117 | rh->dht_heap_node = GNUNET_CONTAINER_heap_insert (dht_lookup_heap, |
1116 | rh, | 1118 | rh, |
1117 | GNUNET_TIME_absolute_get ().abs_value); | 1119 | GNUNET_TIME_absolute_get ().abs_value_us); |
1118 | } | 1120 | } |
1119 | 1121 | ||
1120 | xquery = htonl (rlh->record_type); | 1122 | xquery = htonl (rlh->record_type); |
@@ -1169,7 +1171,7 @@ process_record_result_ns (void* cls, | |||
1169 | if (NULL != name) | 1171 | if (NULL != name) |
1170 | { | 1172 | { |
1171 | rh->status |= RSL_RECORD_EXISTS; | 1173 | rh->status |= RSL_RECORD_EXISTS; |
1172 | if (remaining_time.rel_value == 0) | 1174 | if (remaining_time.rel_value_us == 0) |
1173 | rh->status |= RSL_RECORD_EXPIRED; | 1175 | rh->status |= RSL_RECORD_EXPIRED; |
1174 | } | 1176 | } |
1175 | if (0 == rd_count) | 1177 | if (0 == rd_count) |
@@ -1210,8 +1212,8 @@ process_record_result_ns (void* cls, | |||
1210 | 1212 | ||
1211 | //FIXME: eh? do I have to handle this here? | 1213 | //FIXME: eh? do I have to handle this here? |
1212 | GNUNET_break (0 == (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)); | 1214 | GNUNET_break (0 == (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)); |
1213 | et.abs_value = rd[i].expiration_time; | 1215 | et.abs_value_us = rd[i].expiration_time; |
1214 | if (0 == (GNUNET_TIME_absolute_get_remaining (et)).rel_value) | 1216 | if (0 == (GNUNET_TIME_absolute_get_remaining (et)).rel_value_us) |
1215 | { | 1217 | { |
1216 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1218 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
1217 | "GNS_PHASE_REC-%llu: This record is expired. Skipping\n", | 1219 | "GNS_PHASE_REC-%llu: This record is expired. Skipping\n", |
@@ -1554,7 +1556,7 @@ read_dns_response (void *cls, | |||
1554 | rd.data_size = packet->answers[i].data.raw.data_len; | 1556 | rd.data_size = packet->answers[i].data.raw.data_len; |
1555 | rd.record_type = packet->answers[i].type; | 1557 | rd.record_type = packet->answers[i].type; |
1556 | rd.flags = 0; | 1558 | rd.flags = 0; |
1557 | rd.expiration_time = packet->answers[i].expiration_time.abs_value; | 1559 | rd.expiration_time = packet->answers[i].expiration_time.abs_value_us; |
1558 | finish_lookup (rh, rlh, 1, &rd); | 1560 | finish_lookup (rh, rlh, 1, &rd); |
1559 | GNUNET_DNSPARSER_free_packet (packet); | 1561 | GNUNET_DNSPARSER_free_packet (packet); |
1560 | return; | 1562 | return; |
@@ -1931,9 +1933,10 @@ dht_authority_lookup_timeout (void *cls, | |||
1931 | char new_name[GNUNET_DNSPARSER_MAX_NAME_LENGTH]; | 1933 | char new_name[GNUNET_DNSPARSER_MAX_NAME_LENGTH]; |
1932 | 1934 | ||
1933 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1935 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1934 | "GNS_PHASE_DELEGATE_DHT-%llu: dht lookup for query %s (%llus) timed out.\n", | 1936 | "GNS_PHASE_DELEGATE_DHT-%llu: dht lookup for query %s (%s) timed out.\n", |
1935 | rh->id, rh->authority_name, | 1937 | rh->id, rh->authority_name, |
1936 | rh->timeout.rel_value); | 1938 | GNUNET_STRINGS_relative_time_to_string (rh->timeout, |
1939 | GNUNET_YES)); | ||
1937 | 1940 | ||
1938 | rh->status |= RSL_TIMED_OUT; | 1941 | rh->status |= RSL_TIMED_OUT; |
1939 | rh->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 1942 | rh->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
@@ -2058,13 +2061,13 @@ process_pkey_revocation_result_ns (void *cls, | |||
2058 | } | 2061 | } |
2059 | 2062 | ||
2060 | if ((NULL == name) || | 2063 | if ((NULL == name) || |
2061 | (0 == remaining_time.rel_value)) | 2064 | (0 == remaining_time.rel_value_us)) |
2062 | { | 2065 | { |
2063 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2066 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2064 | "GNS_PHASE_DELEGATE_REV-%llu: + Records don't exist or are expired.\n", | 2067 | "GNS_PHASE_DELEGATE_REV-%llu: + Records don't exist or are expired.\n", |
2065 | rh->id, name); | 2068 | rh->id, name); |
2066 | 2069 | ||
2067 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value != rh->timeout.rel_value) | 2070 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != rh->timeout.rel_value_us) |
2068 | { | 2071 | { |
2069 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 2072 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
2070 | "GNS_PHASE_DELEGATE_REV-%llu: Starting background lookup for %s type %d\n", | 2073 | "GNS_PHASE_DELEGATE_REV-%llu: Starting background lookup for %s type %d\n", |
@@ -2291,7 +2294,7 @@ process_delegation_result_dht (void* cls, | |||
2291 | 2294 | ||
2292 | namestore_bg_task->node = GNUNET_CONTAINER_heap_insert (ns_task_heap, | 2295 | namestore_bg_task->node = GNUNET_CONTAINER_heap_insert (ns_task_heap, |
2293 | namestore_bg_task, | 2296 | namestore_bg_task, |
2294 | GNUNET_TIME_absolute_get().abs_value); | 2297 | GNUNET_TIME_absolute_get().abs_value_us); |
2295 | namestore_bg_task->qe = GNUNET_NAMESTORE_record_put (namestore_handle, | 2298 | namestore_bg_task->qe = GNUNET_NAMESTORE_record_put (namestore_handle, |
2296 | &nrb->public_key, | 2299 | &nrb->public_key, |
2297 | name, | 2300 | name, |
@@ -2762,7 +2765,7 @@ resolve_delegation_dht (struct ResolverHandle *rh) | |||
2762 | &rh->authority, | 2765 | &rh->authority, |
2763 | &lookup_key); | 2766 | &lookup_key); |
2764 | rh->dht_heap_node = NULL; | 2767 | rh->dht_heap_node = NULL; |
2765 | if (rh->timeout.rel_value != GNUNET_TIME_UNIT_FOREVER_REL.rel_value) | 2768 | if (rh->timeout.rel_value_us != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
2766 | { | 2769 | { |
2767 | rh->timeout_cont = &dht_authority_lookup_timeout; | 2770 | rh->timeout_cont = &dht_authority_lookup_timeout; |
2768 | rh->timeout_cont_cls = rh; | 2771 | rh->timeout_cont_cls = rh; |
@@ -2788,7 +2791,7 @@ resolve_delegation_dht (struct ResolverHandle *rh) | |||
2788 | } | 2791 | } |
2789 | rh->dht_heap_node = GNUNET_CONTAINER_heap_insert (dht_lookup_heap, | 2792 | rh->dht_heap_node = GNUNET_CONTAINER_heap_insert (dht_lookup_heap, |
2790 | rh, | 2793 | rh, |
2791 | GNUNET_TIME_absolute_get().abs_value); | 2794 | GNUNET_TIME_absolute_get().abs_value_us); |
2792 | } | 2795 | } |
2793 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2796 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2794 | "Beginning DHT lookup for %s in zone %s for request %llu\n", | 2797 | "Beginning DHT lookup for %s in zone %s for request %llu\n", |
@@ -3096,7 +3099,7 @@ process_delegation_result_ns (void* cls, | |||
3096 | GNUNET_short_h2s (&zone)); | 3099 | GNUNET_short_h2s (&zone)); |
3097 | rh->status |= RSL_RECORD_EXISTS; | 3100 | rh->status |= RSL_RECORD_EXISTS; |
3098 | 3101 | ||
3099 | if (0 == remaining_time.rel_value) | 3102 | if (0 == remaining_time.rel_value_us) |
3100 | { | 3103 | { |
3101 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3104 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3102 | "GNS_PHASE_DELEGATE_NS-%llu: Record set %s expired.\n", | 3105 | "GNS_PHASE_DELEGATE_NS-%llu: Record set %s expired.\n", |
@@ -3194,13 +3197,13 @@ process_delegation_result_ns (void* cls, | |||
3194 | continue; | 3197 | continue; |
3195 | } | 3198 | } |
3196 | GNUNET_break (0 == (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)); | 3199 | GNUNET_break (0 == (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)); |
3197 | et.abs_value = rd[i].expiration_time; | 3200 | et.abs_value_us = rd[i].expiration_time; |
3198 | if (0 == (GNUNET_TIME_absolute_get_remaining (et)).rel_value) | 3201 | if (0 == (GNUNET_TIME_absolute_get_remaining (et)).rel_value_us) |
3199 | { | 3202 | { |
3200 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3203 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3201 | "GNS_PHASE_DELEGATE_NS-%llu: This pkey is expired.\n", | 3204 | "GNS_PHASE_DELEGATE_NS-%llu: This pkey is expired.\n", |
3202 | rh->id); | 3205 | rh->id); |
3203 | if (remaining_time.rel_value == 0) | 3206 | if (remaining_time.rel_value_us == 0) |
3204 | { | 3207 | { |
3205 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3206 | "GNS_PHASE_DELEGATE_NS-%llu: This dht entry is expired.\n", | 3209 | "GNS_PHASE_DELEGATE_NS-%llu: This dht entry is expired.\n", |
@@ -3364,7 +3367,7 @@ gns_resolver_lookup_record (struct GNUNET_CRYPTO_ShortHashCode zone, | |||
3364 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3367 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3365 | "No shorten key for resolution\n"); | 3368 | "No shorten key for resolution\n"); |
3366 | 3369 | ||
3367 | if (timeout.rel_value != GNUNET_TIME_UNIT_FOREVER_REL.rel_value) | 3370 | if (timeout.rel_value_us != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
3368 | { | 3371 | { |
3369 | /* | 3372 | /* |
3370 | * Set timeout for authority lookup phase to 1/2 | 3373 | * Set timeout for authority lookup phase to 1/2 |