diff options
Diffstat (limited to 'src/set')
-rw-r--r-- | src/set/gnunet-service-set.c | 8 | ||||
-rw-r--r-- | src/set/gnunet-set-profiler.c | 4 | ||||
-rw-r--r-- | src/set/set_api.c | 19 | ||||
-rw-r--r-- | src/set/test_set_api.c | 8 | ||||
-rw-r--r-- | src/set/test_set_union_copy.c | 7 | ||||
-rw-r--r-- | src/set/test_set_union_result_symmetric.c | 7 |
6 files changed, 25 insertions, 28 deletions
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c index 4b65fd737..e9555928a 100644 --- a/src/set/gnunet-service-set.c +++ b/src/set/gnunet-service-set.c | |||
@@ -1713,8 +1713,7 @@ handle_client_accept (void *cls, | |||
1713 | * @param tc context information (why was this task triggered now) | 1713 | * @param tc context information (why was this task triggered now) |
1714 | */ | 1714 | */ |
1715 | static void | 1715 | static void |
1716 | shutdown_task (void *cls, | 1716 | shutdown_task (void *cls) |
1717 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1718 | { | 1717 | { |
1719 | while (NULL != incoming_head) | 1718 | while (NULL != incoming_head) |
1720 | incoming_destroy (incoming_head); | 1719 | incoming_destroy (incoming_head); |
@@ -1747,13 +1746,14 @@ shutdown_task (void *cls, | |||
1747 | * @param tc context information (why was this task triggered now) | 1746 | * @param tc context information (why was this task triggered now) |
1748 | */ | 1747 | */ |
1749 | static void | 1748 | static void |
1750 | incoming_timeout_cb (void *cls, | 1749 | incoming_timeout_cb (void *cls) |
1751 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1752 | { | 1750 | { |
1753 | struct Operation *incoming = cls; | 1751 | struct Operation *incoming = cls; |
1752 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
1754 | 1753 | ||
1755 | incoming->timeout_task = NULL; | 1754 | incoming->timeout_task = NULL; |
1756 | GNUNET_assert (GNUNET_YES == incoming->is_incoming); | 1755 | GNUNET_assert (GNUNET_YES == incoming->is_incoming); |
1756 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
1757 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1757 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
1758 | return; | 1758 | return; |
1759 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1759 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/set/gnunet-set-profiler.c b/src/set/gnunet-set-profiler.c index 0586b8b3d..ff76b27ce 100644 --- a/src/set/gnunet-set-profiler.c +++ b/src/set/gnunet-set-profiler.c | |||
@@ -247,8 +247,7 @@ set_insert_iterator (void *cls, | |||
247 | 247 | ||
248 | 248 | ||
249 | static void | 249 | static void |
250 | handle_shutdown (void *cls, | 250 | handle_shutdown (void *cls) |
251 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
252 | { | 251 | { |
253 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 252 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
254 | "Shutting down set profiler\n"); | 253 | "Shutting down set profiler\n"); |
@@ -393,4 +392,3 @@ main (int argc, char **argv) | |||
393 | options, &pre_run, NULL, GNUNET_YES); | 392 | options, &pre_run, NULL, GNUNET_YES); |
394 | return ret; | 393 | return ret; |
395 | } | 394 | } |
396 | |||
diff --git a/src/set/set_api.c b/src/set/set_api.c index 503c0c9c2..772140269 100644 --- a/src/set/set_api.c +++ b/src/set/set_api.c | |||
@@ -275,12 +275,12 @@ handle_copy_lazy (void *cls, | |||
275 | 275 | ||
276 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 276 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
277 | "Handling response to lazy copy\n"); | 277 | "Handling response to lazy copy\n"); |
278 | 278 | ||
279 | GNUNET_CONTAINER_DLL_remove (set->copy_req_head, | 279 | GNUNET_CONTAINER_DLL_remove (set->copy_req_head, |
280 | set->copy_req_tail, | 280 | set->copy_req_tail, |
281 | req); | 281 | req); |
282 | 282 | ||
283 | 283 | ||
284 | // We pass none as operation here, since it doesn't matter when | 284 | // We pass none as operation here, since it doesn't matter when |
285 | // cloning. | 285 | // cloning. |
286 | new_set = create_internal (set->cfg, GNUNET_SET_OPERATION_NONE, &msg->cookie); | 286 | new_set = create_internal (set->cfg, GNUNET_SET_OPERATION_NONE, &msg->cookie); |
@@ -790,11 +790,9 @@ GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer, | |||
790 | * Connect to the set service in order to listen for requests. | 790 | * Connect to the set service in order to listen for requests. |
791 | * | 791 | * |
792 | * @param cls the `struct GNUNET_SET_ListenHandle *` to connect | 792 | * @param cls the `struct GNUNET_SET_ListenHandle *` to connect |
793 | * @param tc task context if invoked as a task, NULL otherwise | ||
794 | */ | 793 | */ |
795 | static void | 794 | static void |
796 | listen_connect (void *cls, | 795 | listen_connect (void *cls); |
797 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
798 | 796 | ||
799 | 797 | ||
800 | /** | 798 | /** |
@@ -882,11 +880,9 @@ handle_client_listener_error (void *cls, | |||
882 | * Connect to the set service in order to listen for requests. | 880 | * Connect to the set service in order to listen for requests. |
883 | * | 881 | * |
884 | * @param cls the `struct GNUNET_SET_ListenHandle *` to connect | 882 | * @param cls the `struct GNUNET_SET_ListenHandle *` to connect |
885 | * @param tc task context if invoked as a task, NULL otherwise | ||
886 | */ | 883 | */ |
887 | static void | 884 | static void |
888 | listen_connect (void *cls, | 885 | listen_connect (void *cls) |
889 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
890 | { | 886 | { |
891 | static const struct GNUNET_MQ_MessageHandler mq_handlers[] = { | 887 | static const struct GNUNET_MQ_MessageHandler mq_handlers[] = { |
892 | { &handle_request, GNUNET_MESSAGE_TYPE_SET_REQUEST }, | 888 | { &handle_request, GNUNET_MESSAGE_TYPE_SET_REQUEST }, |
@@ -895,9 +891,10 @@ listen_connect (void *cls, | |||
895 | struct GNUNET_SET_ListenHandle *lh = cls; | 891 | struct GNUNET_SET_ListenHandle *lh = cls; |
896 | struct GNUNET_MQ_Envelope *mqm; | 892 | struct GNUNET_MQ_Envelope *mqm; |
897 | struct GNUNET_SET_ListenMessage *msg; | 893 | struct GNUNET_SET_ListenMessage *msg; |
894 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
898 | 895 | ||
899 | if ( (NULL != tc) && | 896 | tc = GNUNET_SCHEDULER_get_task_context (); |
900 | (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) ) | 897 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
901 | { | 898 | { |
902 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 899 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
903 | "Listener not reconnecting due to shutdown\n"); | 900 | "Listener not reconnecting due to shutdown\n"); |
@@ -947,7 +944,7 @@ GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
947 | lh->operation = operation; | 944 | lh->operation = operation; |
948 | lh->app_id = *app_id; | 945 | lh->app_id = *app_id; |
949 | lh->reconnect_backoff = GNUNET_TIME_UNIT_MILLISECONDS; | 946 | lh->reconnect_backoff = GNUNET_TIME_UNIT_MILLISECONDS; |
950 | listen_connect (lh, NULL); | 947 | listen_connect (lh); |
951 | if (NULL == lh->client) | 948 | if (NULL == lh->client) |
952 | { | 949 | { |
953 | GNUNET_free (lh); | 950 | GNUNET_free (lh); |
diff --git a/src/set/test_set_api.c b/src/set/test_set_api.c index fbb303257..b5c21f8a3 100644 --- a/src/set/test_set_api.c +++ b/src/set/test_set_api.c | |||
@@ -246,12 +246,13 @@ test_iter () | |||
246 | * Signature of the main function of a task. | 246 | * Signature of the main function of a task. |
247 | * | 247 | * |
248 | * @param cls closure | 248 | * @param cls closure |
249 | * @param tc context information (why was this task triggered now) | ||
250 | */ | 249 | */ |
251 | static void | 250 | static void |
252 | timeout_fail (void *cls, | 251 | timeout_fail (void *cls) |
253 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
254 | { | 252 | { |
253 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
254 | |||
255 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
255 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 256 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
256 | return; | 257 | return; |
257 | GNUNET_SCHEDULER_shutdown (); | 258 | GNUNET_SCHEDULER_shutdown (); |
@@ -316,4 +317,3 @@ main (int argc, char **argv) | |||
316 | } | 317 | } |
317 | return ret; | 318 | return ret; |
318 | } | 319 | } |
319 | |||
diff --git a/src/set/test_set_union_copy.c b/src/set/test_set_union_copy.c index 247d91498..fdf6bf9df 100644 --- a/src/set/test_set_union_copy.c +++ b/src/set/test_set_union_copy.c | |||
@@ -73,12 +73,13 @@ remove_element_str (struct GNUNET_SET_Handle *set, char *str) | |||
73 | * Signature of the main function of a task. | 73 | * Signature of the main function of a task. |
74 | * | 74 | * |
75 | * @param cls closure | 75 | * @param cls closure |
76 | * @param tc context information (why was this task triggered now) | ||
77 | */ | 76 | */ |
78 | static void | 77 | static void |
79 | timeout_fail (void *cls, | 78 | timeout_fail (void *cls) |
80 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
81 | { | 79 | { |
80 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
81 | |||
82 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
82 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 83 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
83 | return; | 84 | return; |
84 | GNUNET_SCHEDULER_shutdown (); | 85 | GNUNET_SCHEDULER_shutdown (); |
diff --git a/src/set/test_set_union_result_symmetric.c b/src/set/test_set_union_result_symmetric.c index 9a49abaf0..b312bcb4c 100644 --- a/src/set/test_set_union_result_symmetric.c +++ b/src/set/test_set_union_result_symmetric.c | |||
@@ -293,12 +293,13 @@ test_iter () | |||
293 | * Signature of the main function of a task. | 293 | * Signature of the main function of a task. |
294 | * | 294 | * |
295 | * @param cls closure | 295 | * @param cls closure |
296 | * @param tc context information (why was this task triggered now) | ||
297 | */ | 296 | */ |
298 | static void | 297 | static void |
299 | timeout_fail (void *cls, | 298 | timeout_fail (void *cls) |
300 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
301 | { | 299 | { |
300 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
301 | |||
302 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
302 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 303 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
303 | return; | 304 | return; |
304 | GNUNET_SCHEDULER_shutdown (); | 305 | GNUNET_SCHEDULER_shutdown (); |