aboutsummaryrefslogtreecommitdiff
path: root/src/dns/dnsstub.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-10-18 09:42:34 +0000
committerChristian Grothoff <christian@grothoff.org>2012-10-18 09:42:34 +0000
commit50f76ab44c5cb28c0aa92a2a54f50d9ba10a46ee (patch)
tree43fd03278cc142372846018d43f0cb80ef37550c /src/dns/dnsstub.c
parentedbebab8a0ec393c3132edc78399c9951e123fdf (diff)
downloadgnunet-50f76ab44c5cb28c0aa92a2a54f50d9ba10a46ee.tar.gz
gnunet-50f76ab44c5cb28c0aa92a2a54f50d9ba10a46ee.zip
-misc bugfixes
Diffstat (limited to 'src/dns/dnsstub.c')
-rw-r--r--src/dns/dnsstub.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/dns/dnsstub.c b/src/dns/dnsstub.c
index 687259feb..c755aff16 100644
--- a/src/dns/dnsstub.c
+++ b/src/dns/dnsstub.c
@@ -279,6 +279,10 @@ GNUNET_DNSSTUB_resolve (struct GNUNET_DNSSTUB_Context *ctx,
279 else 279 else
280 ret = rs->dnsout6; 280 ret = rs->dnsout6;
281 GNUNET_assert (NULL != ret); 281 GNUNET_assert (NULL != ret);
282 memcpy (&rs->addr,
283 sa,
284 sa_len);
285 rs->addrlen = sa_len;
282 rs->rc = rc; 286 rs->rc = rc;
283 rs->rc_cls = rc_cls; 287 rs->rc_cls = rc_cls;
284 if (GNUNET_SYSERR == 288 if (GNUNET_SYSERR ==
@@ -290,6 +294,10 @@ GNUNET_DNSSTUB_resolve (struct GNUNET_DNSSTUB_Context *ctx,
290 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 294 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
291 _("Failed to send DNS request to %s\n"), 295 _("Failed to send DNS request to %s\n"),
292 GNUNET_a2s (sa, sa_len)); 296 GNUNET_a2s (sa, sa_len));
297 else
298 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
299 _("Sent DNS request to %s\n"),
300 GNUNET_a2s (sa, sa_len));
293 return rs; 301 return rs;
294} 302}
295 303
@@ -409,7 +417,9 @@ do_dns_read (struct GNUNET_DNSSTUB_RequestSocket *rs,
409 /* port the code above? */ 417 /* port the code above? */
410 len = UINT16_MAX; 418 len = UINT16_MAX;
411#endif 419#endif
412 420 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
421 "Receiving %d byte DNS reply\n",
422 len);
413 { 423 {
414 unsigned char buf[len] GNUNET_ALIGN; 424 unsigned char buf[len] GNUNET_ALIGN;
415 425
@@ -437,7 +447,11 @@ do_dns_read (struct GNUNET_DNSSTUB_RequestSocket *rs,
437 &addr, 447 &addr,
438 addrlen)) || 448 addrlen)) ||
439 (0 == GNUNET_TIME_absolute_get_remaining (rs->timeout).rel_value) ) 449 (0 == GNUNET_TIME_absolute_get_remaining (rs->timeout).rel_value) )
450 {
451 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
452 "Request timeout or invalid sender address; ignoring reply\n");
440 return GNUNET_NO; 453 return GNUNET_NO;
454 }
441 if (NULL != rs->rc) 455 if (NULL != rs->rc)
442 rs->rc (rs->rc_cls, 456 rs->rc (rs->rc_cls,
443 rs, 457 rs,