allow empty/NULL context message
[oweals/gnunet.git] / src / transport / plugin_transport_unix.c
index 5ad5a04323c70368bab55aa4a26e4bcb62fea57b..d0566c2d30636d90fb8b8aa73cbe623b1f4cb666 100644 (file)
@@ -498,11 +498,9 @@ unix_plugin_session_disconnect (void *cls,
  * Session was idle for too long, so disconnect it
  *
  * @param cls the `struct GNUNET_ATS_Session *` to disconnect
- * @param tc scheduler context
  */
 static void
-session_timeout (void *cls,
-                const struct GNUNET_SCHEDULER_TaskContext *tc)
+session_timeout (void *cls)
 {
   struct GNUNET_ATS_Session *session = cls;
   struct GNUNET_TIME_Relative left;
@@ -1225,17 +1223,15 @@ unix_plugin_do_write (struct Plugin *plugin)
  * Then reschedule this function to be called again once more is available.
  *
  * @param cls the plugin handle
- * @param tc the scheduling context
  */
 static void
-unix_plugin_select_read (void *cls,
-                         const struct GNUNET_SCHEDULER_TaskContext *tc)
+unix_plugin_select_read (void *cls)
 {
   struct Plugin *plugin = cls;
-
+  const struct GNUNET_SCHEDULER_TaskContext *tc;
+  
   plugin->read_task = NULL;
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    return;
+  tc = GNUNET_SCHEDULER_get_task_context ();
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
     unix_plugin_do_read (plugin);
   plugin->read_task =
@@ -1250,17 +1246,15 @@ unix_plugin_select_read (void *cls,
  * Then reschedule this function to be called again once more is available.
  *
  * @param cls the plugin handle
- * @param tc the scheduling context
  */
 static void
-unix_plugin_select_write (void *cls,
-                         const struct GNUNET_SCHEDULER_TaskContext *tc)
+unix_plugin_select_write (void *cls)
 {
   struct Plugin *plugin = cls;
-
+  const struct GNUNET_SCHEDULER_TaskContext *tc;
+  
   plugin->write_task = NULL;
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    return;
+  tc = GNUNET_SCHEDULER_get_task_context ();
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_WRITE_READY))
     unix_plugin_do_write (plugin);
   if (NULL == plugin->msg_head)
@@ -1617,11 +1611,9 @@ unix_plugin_string_to_address (void *cls,
  * Notify transport service about address
  *
  * @param cls the plugin
- * @param tc unused
  */
 static void
-address_notification (void *cls,
-                     const struct GNUNET_SCHEDULER_TaskContext *tc)
+address_notification (void *cls)
 {
   struct Plugin *plugin = cls;
   struct GNUNET_HELLO_Address *address;