aboutsummaryrefslogtreecommitdiff
path: root/src/dns/gnunet-zoneimport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dns/gnunet-zoneimport.c')
-rw-r--r--src/dns/gnunet-zoneimport.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/dns/gnunet-zoneimport.c b/src/dns/gnunet-zoneimport.c
index 914868af4..860672e7a 100644
--- a/src/dns/gnunet-zoneimport.c
+++ b/src/dns/gnunet-zoneimport.c
@@ -290,13 +290,11 @@ process_record (struct Request *req,
290 * Function called with the result of a DNS resolution. 290 * Function called with the result of a DNS resolution.
291 * 291 *
292 * @param cls closure with the `struct Request` 292 * @param cls closure with the `struct Request`
293 * @param rs socket that received the response
294 * @param dns dns response, never NULL 293 * @param dns dns response, never NULL
295 * @param dns_len number of bytes in @a dns 294 * @param dns_len number of bytes in @a dns
296 */ 295 */
297static void 296static void
298process_result (void *cls, 297process_result (void *cls,
299 struct GNUNET_DNSSTUB_RequestSocket *rs,
300 const struct GNUNET_TUN_DnsHeader *dns, 298 const struct GNUNET_TUN_DnsHeader *dns,
301 size_t dns_len) 299 size_t dns_len)
302{ 300{
@@ -407,11 +405,11 @@ submit_req (struct Request *req)
407 (pending >= THRESH) ) 405 (pending >= THRESH) )
408 return GNUNET_SYSERR; 406 return GNUNET_SYSERR;
409 GNUNET_assert (NULL == req->rs); 407 GNUNET_assert (NULL == req->rs);
410 req->rs = GNUNET_DNSSTUB_resolve2 (ctx, 408 req->rs = GNUNET_DNSSTUB_resolve (ctx,
411 req->raw, 409 req->raw,
412 req->raw_len, 410 req->raw_len,
413 &process_result, 411 &process_result,
414 req); 412 req);
415 GNUNET_assert (NULL != req->rs); 413 GNUNET_assert (NULL != req->rs);
416 req->issue_num++; 414 req->issue_num++;
417 last_request = now; 415 last_request = now;
@@ -561,13 +559,23 @@ main (int argc,
561 "Missing required configuration argument\n"); 559 "Missing required configuration argument\n");
562 return -1; 560 return -1;
563 } 561 }
564 ctx = GNUNET_DNSSTUB_start (argv[1]); 562 ctx = GNUNET_DNSSTUB_start (256);
565 if (NULL == ctx) 563 if (NULL == ctx)
566 { 564 {
567 fprintf (stderr, 565 fprintf (stderr,
568 "Failed to initialize GNUnet DNS STUB\n"); 566 "Failed to initialize GNUnet DNS STUB\n");
569 return 1; 567 return 1;
570 } 568 }
569 if (GNUNET_OK !=
570 GNUNET_DNSSTUB_add_dns_ip (ctx,
571 argv[1]))
572 {
573 fprintf (stderr,
574 "Failed to use `%s' for DNS resolver\n",
575 argv[1]);
576 return 1;
577 }
578
571 while (NULL != 579 while (NULL !=
572 fgets (hn, 580 fgets (hn,
573 sizeof (hn), 581 sizeof (hn),