GNUNET_assert (dns_connection == NULL);
dns_connection = GNUNET_CLIENT_connect ("dns", cfg);
/* This would most likely be a misconfiguration */
- GNUNET_assert(dns_connection != NULL);
+ GNUNET_assert(NULL != dns_connection);
GNUNET_CLIENT_receive(dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL);
+ /* We might not yet be connected. Yay, mps. */
+ if (NULL == dns_connection) return;
+
/* If a packet is already in the list, schedule to send it */
if (head != NULL)
GNUNET_CLIENT_notify_transmit_ready(dns_connection,
* The routing-table gets flushed if an interface disappears.
*/
restart_hijack = 1;
- GNUNET_CLIENT_notify_transmit_ready(dns_connection, sizeof(struct GNUNET_MessageHeader), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, &send_query, NULL);
+ if (NULL != dns_connection)
+ GNUNET_CLIENT_notify_transmit_ready(dns_connection, sizeof(struct GNUNET_MessageHeader), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, &send_query, NULL);
}
/*}}}*/