update tests to use new MQ API
[oweals/gnunet.git] / src / dns / dnsstub.c
index 9916b969e85c7b73e2fab3c0ad894f6c38d0d1ce..50a3320fbf9bf6cdca5301683a18228a37fddde3 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2012 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2012 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -185,11 +185,9 @@ open_socket (int af)
  * Read a DNS response from the (unhindered) UDP-Socket
  *
  * @param cls socket to read from
- * @param tc scheduler context (must be shutdown or read ready)
  */
 static void
-read_response (void *cls,
-              const struct GNUNET_SCHEDULER_TaskContext *tc);
+read_response (void *cls);
 
 
 /**
@@ -438,7 +436,7 @@ do_dns_read (struct GNUNET_DNSSTUB_RequestSocket *rs,
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                  _("Received DNS response that is too small (%u bytes)"),
-                 r);
+                 (unsigned int) r);
       return GNUNET_NO;
     }
     dns = (struct GNUNET_TUN_DnsHeader *) buf;
@@ -466,19 +464,19 @@ do_dns_read (struct GNUNET_DNSSTUB_RequestSocket *rs,
  * Read a DNS response from the (unhindered) UDP-Socket
  *
  * @param cls socket to read from
- * @param tc scheduler context (must be shutdown or read ready)
  */
 static void
-read_response (void *cls,
-              const struct GNUNET_SCHEDULER_TaskContext *tc)
+read_response (void *cls)
 {
   struct GNUNET_DNSSTUB_RequestSocket *rs = cls;
   struct GNUNET_NETWORK_FDSet *rset;
+  const struct GNUNET_SCHEDULER_TaskContext *tc;
 
   rs->read_task = NULL;
+  tc = GNUNET_SCHEDULER_get_task_context ();
   if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
   {
-    /* timeout or shutdown */
+    /* timeout */
     cleanup_rs (rs);
     return;
   }