aboutsummaryrefslogtreecommitdiff
path: root/src/dns/dns_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-02 05:03:07 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-02 05:03:07 +0000
commitb75373955d92c8ac1e9554182025843c01cbb96c (patch)
tree701cd50e4282eabc8bbd4ab622ee6e5b1d00447b /src/dns/dns_api.c
parenta0ba564746ecdff082ac3982d4d911f91deb8ab7 (diff)
downloadgnunet-b75373955d92c8ac1e9554182025843c01cbb96c.tar.gz
gnunet-b75373955d92c8ac1e9554182025843c01cbb96c.zip
-again moving towards DNS API sanity
Diffstat (limited to 'src/dns/dns_api.c')
-rw-r--r--src/dns/dns_api.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/dns/dns_api.c b/src/dns/dns_api.c
index 68b703eba..7a1577365 100644
--- a/src/dns/dns_api.c
+++ b/src/dns/dns_api.c
@@ -19,7 +19,7 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file vpn/gnunet-daemon-vpn-dns.c 22 * @file dns/dns_api.c
23 * @brief 23 * @brief
24 * @author Philipp Toelke 24 * @author Philipp Toelke
25 */ 25 */
@@ -56,7 +56,7 @@ struct GNUNET_DNS_Handle
56 56
57 const struct GNUNET_CONFIGURATION_Handle *cfg; 57 const struct GNUNET_CONFIGURATION_Handle *cfg;
58 58
59 GNUNET_SCHEDULER_Task process_answer_cb; 59 GNUNET_DNS_ResponseCallback process_answer_cb;
60 60
61 void *process_answer_cb_cls; 61 void *process_answer_cb_cls;
62}; 62};
@@ -177,11 +177,8 @@ dns_answer_handler (void *cls,
177#endif 177#endif
178 return; 178 return;
179 } 179 }
180 void *pkt = GNUNET_malloc (ntohs (msg->size)); 180 h->process_answer_cb (h->process_answer_cb_cls,
181 181 (const struct answer_packet*) msg);
182 memcpy (pkt, msg, ntohs (msg->size));
183
184 GNUNET_SCHEDULER_add_now (h->process_answer_cb, pkt);
185 GNUNET_CLIENT_receive (h->dns_connection, &dns_answer_handler, h, 182 GNUNET_CLIENT_receive (h->dns_connection, &dns_answer_handler, h,
186 GNUNET_TIME_UNIT_FOREVER_REL); 183 GNUNET_TIME_UNIT_FOREVER_REL);
187} 184}
@@ -192,7 +189,7 @@ dns_answer_handler (void *cls,
192 */ 189 */
193struct GNUNET_DNS_Handle * 190struct GNUNET_DNS_Handle *
194GNUNET_DNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, 191GNUNET_DNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
195 GNUNET_SCHEDULER_Task cb, 192 GNUNET_DNS_ResponseCallback cb,
196 void *cb_cls) 193 void *cb_cls)
197{ 194{
198 struct GNUNET_DNS_Handle *h; 195 struct GNUNET_DNS_Handle *h;