-bringing copyright tags up to FSF standard
[oweals/gnunet.git] / src / transport / transport_api_monitor_plugins.c
index 1bbb4c102d98b4e4684e7a34b51f36ba8990b4a4..7c11194f2ce3d1cee9f7b60600a88a5faeb9124d 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2014 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2014 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -72,7 +72,7 @@ struct GNUNET_TRANSPORT_PluginMonitor
   /**
    * Task ID for reconnect.
    */
-  GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+  struct GNUNET_SCHEDULER_Task * reconnect_task;
 
 };
 
@@ -141,7 +141,7 @@ do_plugin_connect (void *cls,
 {
   struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
 
-  pm->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+  pm->reconnect_task = NULL;
   pm->client = GNUNET_CLIENT_connect ("transport", pm->cfg);
   GNUNET_assert (NULL != pm->client);
   send_plugin_mon_request (pm);
@@ -304,6 +304,10 @@ response_processor (void *cls,
             NULL,
             NULL,
             NULL);
+    GNUNET_CLIENT_receive (pm->client,
+                           &response_processor,
+                           pm,
+                           GNUNET_TIME_UNIT_FOREVER_REL);
     return;
   }
 
@@ -383,6 +387,10 @@ response_processor (void *cls,
                                                            ps));
     GNUNET_free (ps);
   }
+  GNUNET_CLIENT_receive (pm->client,
+                         &response_processor,
+                         pm,
+                         GNUNET_TIME_UNIT_FOREVER_REL);
 }
 
 
@@ -434,10 +442,10 @@ GNUNET_TRANSPORT_monitor_plugins_cancel (struct GNUNET_TRANSPORT_PluginMonitor *
     GNUNET_CLIENT_disconnect (pm->client);
     pm->client = NULL;
   }
-  if (GNUNET_SCHEDULER_NO_TASK != pm->reconnect_task)
+  if (NULL != pm->reconnect_task)
   {
     GNUNET_SCHEDULER_cancel (pm->reconnect_task);
-    pm->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+    pm->reconnect_task = NULL;
   }
   clear_map (pm);
   GNUNET_CONTAINER_multihashmap32_destroy (pm->sessions);