diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-27 14:04:52 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-27 14:04:52 +0000 |
commit | 702a86183ffb2a42a23cb12b13835ad4e4e58f54 (patch) | |
tree | 67f99af4e93812e7115338f871435b507243fd1d /src/gns/gnunet-service-gns_interceptor.c | |
parent | b8d6ef88804a955763b9252025d69a33a49c7533 (diff) | |
download | gnunet-702a86183ffb2a42a23cb12b13835ad4e4e58f54.tar.gz gnunet-702a86183ffb2a42a23cb12b13835ad4e4e58f54.zip |
-lots of fixes, new dht test
Diffstat (limited to 'src/gns/gnunet-service-gns_interceptor.c')
-rw-r--r-- | src/gns/gnunet-service-gns_interceptor.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gns/gnunet-service-gns_interceptor.c b/src/gns/gnunet-service-gns_interceptor.c index ca46fa1ae..b3ecdfdf9 100644 --- a/src/gns/gnunet-service-gns_interceptor.c +++ b/src/gns/gnunet-service-gns_interceptor.c | |||
@@ -67,6 +67,11 @@ static struct GNUNET_CRYPTO_ShortHashCode our_zone; | |||
67 | static struct GNUNET_CRYPTO_RsaPrivateKey *our_key; | 67 | static struct GNUNET_CRYPTO_RsaPrivateKey *our_key; |
68 | 68 | ||
69 | /** | 69 | /** |
70 | * Default timeout | ||
71 | */ | ||
72 | static struct GNUNET_TIME_Relative default_lookup_timeout; | ||
73 | |||
74 | /** | ||
70 | * Reply to dns request with the result from our lookup. | 75 | * Reply to dns request with the result from our lookup. |
71 | * | 76 | * |
72 | * @param cls the closure to the request (an InterceptLookupHandle) | 77 | * @param cls the closure to the request (an InterceptLookupHandle) |
@@ -240,7 +245,7 @@ start_resolution_for_dns(struct GNUNET_DNS_RequestHandle *request, | |||
240 | /* Start resolution in our zone */ | 245 | /* Start resolution in our zone */ |
241 | gns_resolver_lookup_record(our_zone, q->type, q->name, | 246 | gns_resolver_lookup_record(our_zone, q->type, q->name, |
242 | our_key, | 247 | our_key, |
243 | GNUNET_GNS_DEFAULT_LOOKUP_TIMEOUT, | 248 | default_lookup_timeout, |
244 | &reply_to_dns, ilh); | 249 | &reply_to_dns, ilh); |
245 | } | 250 | } |
246 | 251 | ||
@@ -341,6 +346,8 @@ gns_interceptor_init(struct GNUNET_CRYPTO_ShortHashCode zone, | |||
341 | struct GNUNET_CRYPTO_RsaPrivateKey *key, | 346 | struct GNUNET_CRYPTO_RsaPrivateKey *key, |
342 | const struct GNUNET_CONFIGURATION_Handle *c) | 347 | const struct GNUNET_CONFIGURATION_Handle *c) |
343 | { | 348 | { |
349 | unsigned long long default_lookup_timeout_secs = 0; | ||
350 | |||
344 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | 351 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
345 | "DNS hijacking enabled... connecting to service.\n"); | 352 | "DNS hijacking enabled... connecting to service.\n"); |
346 | 353 | ||
@@ -353,6 +360,17 @@ gns_interceptor_init(struct GNUNET_CRYPTO_ShortHashCode zone, | |||
353 | GNUNET_DNS_FLAG_PRE_RESOLUTION, | 360 | GNUNET_DNS_FLAG_PRE_RESOLUTION, |
354 | &handle_dns_request, /* rh */ | 361 | &handle_dns_request, /* rh */ |
355 | NULL); /* Closure */ | 362 | NULL); /* Closure */ |
363 | |||
364 | if (GNUNET_OK == | ||
365 | GNUNET_CONFIGURATION_get_value_number(c, "gns", | ||
366 | "DEFAULT_LOOKUP_TIMEOUT", | ||
367 | &default_lookup_timeout_secs)) | ||
368 | { | ||
369 | default_lookup_timeout = GNUNET_TIME_relative_multiply( | ||
370 | GNUNET_TIME_UNIT_SECONDS, | ||
371 | default_lookup_timeout_secs); | ||
372 | } | ||
373 | |||
356 | if (NULL == dns_handle) | 374 | if (NULL == dns_handle) |
357 | { | 375 | { |
358 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, | 376 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, |