-fix
authorChristian Grothoff <christian@grothoff.org>
Fri, 24 Feb 2012 14:29:03 +0000 (14:29 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 24 Feb 2012 14:29:03 +0000 (14:29 +0000)
src/dns/gnunet-service-dns.c

index b35ea6c27376ab60250f685f4aa15b9bca5ca548..c3c9791a45fa5f0511cf90fa60b0fa127e359615 100644 (file)
@@ -44,6 +44,7 @@
 #include "gnunet_signatures.h"
 #include "dns.h"
 #include "gnunet_dns_service.h"
+#include "gnunet_dnsparser_lib.h"
 #include "gnunet_mesh_service.h"
 #include "gnunet_statistics_service.h"
 #include "gnunet_tun_lib.h"
@@ -1206,6 +1207,16 @@ handle_client_response (void *cls GNUNET_UNUSED,
                           rr->client_wait_list_length,
                           0);
       }
+      /* if query changed to answer, move past DNS resolution phase... */
+      if ( (RP_REQUEST_MONITOR == rr->phase) &&
+          (rr->payload_length > sizeof (struct GNUNET_TUN_DnsHeader)) &&
+          ((struct GNUNET_DNSPARSER_Flags*)&(((struct GNUNET_TUN_DnsHeader*) rr->payload)->flags))->query_or_response == 1)
+      {
+       rr->phase = RP_INTERNET_DNS;
+       GNUNET_array_grow (rr->client_wait_list,
+                          rr->client_wait_list_length,
+                          0);
+      }
       break;
     }
     next_phase (rr);