- struct GNUNET_DNS_Handle *h;
-
- h = GNUNET_malloc (sizeof (struct GNUNET_DNS_Handle));
- h->cfg = cfg;
- h->process_answer_cb = cb;
- h->process_answer_cb_cls = cb_cls;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to service-dns\n");
- h->dns_connection = GNUNET_CLIENT_connect ("dns", h->cfg);
- /* This would most likely be a misconfiguration */
- GNUNET_assert (NULL != h->dns_connection);
- GNUNET_CLIENT_receive (h->dns_connection,
- &dns_answer_handler, NULL,
- GNUNET_TIME_UNIT_FOREVER_REL);
- /* If a packet is already in the list, schedule to send it */
- if (h->dns_transmit_handle == NULL && h->head != NULL)
- h->dns_transmit_handle =
- GNUNET_CLIENT_notify_transmit_ready (h->dns_connection,
- ntohs (h->head->pkt.hdr.size),
- GNUNET_TIME_UNIT_FOREVER_REL,
- GNUNET_YES, &send_query, h);
- else if (h->dns_transmit_handle == NULL && h->restart_hijack == 1)