diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
commit | 29e6158507a0758192075ac6ece7ba8e75ddc49a (patch) | |
tree | b91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/transport/plugin_transport_unix.c | |
parent | 5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff) | |
download | gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.tar.gz gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.zip |
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/transport/plugin_transport_unix.c')
-rw-r--r-- | src/transport/plugin_transport_unix.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index 5ad5a0432..e320785d4 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c | |||
@@ -498,11 +498,9 @@ unix_plugin_session_disconnect (void *cls, | |||
498 | * Session was idle for too long, so disconnect it | 498 | * Session was idle for too long, so disconnect it |
499 | * | 499 | * |
500 | * @param cls the `struct GNUNET_ATS_Session *` to disconnect | 500 | * @param cls the `struct GNUNET_ATS_Session *` to disconnect |
501 | * @param tc scheduler context | ||
502 | */ | 501 | */ |
503 | static void | 502 | static void |
504 | session_timeout (void *cls, | 503 | session_timeout (void *cls) |
505 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
506 | { | 504 | { |
507 | struct GNUNET_ATS_Session *session = cls; | 505 | struct GNUNET_ATS_Session *session = cls; |
508 | struct GNUNET_TIME_Relative left; | 506 | struct GNUNET_TIME_Relative left; |
@@ -1225,14 +1223,14 @@ unix_plugin_do_write (struct Plugin *plugin) | |||
1225 | * Then reschedule this function to be called again once more is available. | 1223 | * Then reschedule this function to be called again once more is available. |
1226 | * | 1224 | * |
1227 | * @param cls the plugin handle | 1225 | * @param cls the plugin handle |
1228 | * @param tc the scheduling context | ||
1229 | */ | 1226 | */ |
1230 | static void | 1227 | static void |
1231 | unix_plugin_select_read (void *cls, | 1228 | unix_plugin_select_read (void *cls) |
1232 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1233 | { | 1229 | { |
1234 | struct Plugin *plugin = cls; | 1230 | struct Plugin *plugin = cls; |
1231 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1235 | 1232 | ||
1233 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1236 | plugin->read_task = NULL; | 1234 | plugin->read_task = NULL; |
1237 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1235 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1238 | return; | 1236 | return; |
@@ -1250,14 +1248,14 @@ unix_plugin_select_read (void *cls, | |||
1250 | * Then reschedule this function to be called again once more is available. | 1248 | * Then reschedule this function to be called again once more is available. |
1251 | * | 1249 | * |
1252 | * @param cls the plugin handle | 1250 | * @param cls the plugin handle |
1253 | * @param tc the scheduling context | ||
1254 | */ | 1251 | */ |
1255 | static void | 1252 | static void |
1256 | unix_plugin_select_write (void *cls, | 1253 | unix_plugin_select_write (void *cls) |
1257 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1258 | { | 1254 | { |
1259 | struct Plugin *plugin = cls; | 1255 | struct Plugin *plugin = cls; |
1256 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1260 | 1257 | ||
1258 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1261 | plugin->write_task = NULL; | 1259 | plugin->write_task = NULL; |
1262 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1260 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1263 | return; | 1261 | return; |
@@ -1617,11 +1615,9 @@ unix_plugin_string_to_address (void *cls, | |||
1617 | * Notify transport service about address | 1615 | * Notify transport service about address |
1618 | * | 1616 | * |
1619 | * @param cls the plugin | 1617 | * @param cls the plugin |
1620 | * @param tc unused | ||
1621 | */ | 1618 | */ |
1622 | static void | 1619 | static void |
1623 | address_notification (void *cls, | 1620 | address_notification (void *cls) |
1624 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1625 | { | 1621 | { |
1626 | struct Plugin *plugin = cls; | 1622 | struct Plugin *plugin = cls; |
1627 | struct GNUNET_HELLO_Address *address; | 1623 | struct GNUNET_HELLO_Address *address; |