aboutsummaryrefslogtreecommitdiff
path: root/src/regex/gnunet-regex-profiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex/gnunet-regex-profiler.c')
-rw-r--r--src/regex/gnunet-regex-profiler.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c
index 5fe6186cf..5938c99b1 100644
--- a/src/regex/gnunet-regex-profiler.c
+++ b/src/regex/gnunet-regex-profiler.c
@@ -384,10 +384,9 @@ stats_connect_cb (void *cls,
384 * Start announcing the next regex in the DHT. 384 * Start announcing the next regex in the DHT.
385 * 385 *
386 * @param cls Index of the next peer in the peers array. 386 * @param cls Index of the next peer in the peers array.
387 * @param tc TaskContext.
388 */ 387 */
389static void 388static void
390announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 389announce_next_regex (void *cls);
391 390
392 391
393/******************************************************************************/ 392/******************************************************************************/
@@ -399,10 +398,9 @@ announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
399 * Shutdown nicely 398 * Shutdown nicely
400 * 399 *
401 * @param cls NULL 400 * @param cls NULL
402 * @param tc the task context
403 */ 401 */
404static void 402static void
405do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 403do_shutdown (void *cls)
406{ 404{
407 struct RegexPeer *peer; 405 struct RegexPeer *peer;
408 unsigned int peer_cnt; 406 unsigned int peer_cnt;
@@ -471,10 +469,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
471 * abort task to run on test timed out 469 * abort task to run on test timed out
472 * 470 *
473 * @param cls NULL 471 * @param cls NULL
474 * @param tc the task context
475 */ 472 */
476static void 473static void
477do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 474do_abort (void *cls)
478{ 475{
479 unsigned long i = (unsigned long) cls; 476 unsigned long i = (unsigned long) cls;
480 477
@@ -664,10 +661,9 @@ stats_connect_cb (void *cls,
664 * profiler, when done. 661 * profiler, when done.
665 * 662 *
666 * @param cls NULL 663 * @param cls NULL
667 * @param tc the task context
668 */ 664 */
669static void 665static void
670do_collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 666do_collect_stats (void *cls)
671{ 667{
672 struct RegexPeer *peer = &peers[0]; 668 struct RegexPeer *peer = &peers[0];
673 669
@@ -694,10 +690,9 @@ do_collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
694 * Start searching for the next string in the DHT. 690 * Start searching for the next string in the DHT.
695 * 691 *
696 * @param cls Index of the next peer in the peers array. 692 * @param cls Index of the next peer in the peers array.
697 * @param tc TaskContext.
698 */ 693 */
699static void 694static void
700find_string (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 695find_string (void *cls);
701 696
702 697
703/** 698/**
@@ -808,10 +803,9 @@ regex_found_handler (void *cls,
808 * specified timeout 'search_timeout'. 803 * specified timeout 'search_timeout'.
809 * 804 *
810 * @param cls NULL 805 * @param cls NULL
811 * @param tc the task context
812 */ 806 */
813static void 807static void
814search_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) 808search_timed_out (void *cls)
815{ 809{
816 unsigned int i; 810 unsigned int i;
817 811
@@ -846,15 +840,15 @@ search_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc)
846 * but we should start another one. 840 * but we should start another one.
847 * 841 *
848 * @param cls Index of the next peer in the peers array. 842 * @param cls Index of the next peer in the peers array.
849 * @param tc TaskContext.
850 */ 843 */
851static void 844static void
852find_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 845find_timed_out (void *cls)
853{ 846{
854 struct RegexPeer *p = cls; 847 struct RegexPeer *p = cls;
848 const struct GNUNET_SCHEDULER_TaskContext *tc;
855 849
856 p->timeout = NULL; 850 p->timeout = NULL;
857 851 tc = GNUNET_SCHEDULER_get_task_context ();
858 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 852 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
859 return; 853 return;
860 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 854 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -870,13 +864,14 @@ find_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
870 * Start searching for a string in the DHT. 864 * Start searching for a string in the DHT.
871 * 865 *
872 * @param cls Index of the next peer in the peers array. 866 * @param cls Index of the next peer in the peers array.
873 * @param tc TaskContext.
874 */ 867 */
875static void 868static void
876find_string (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 869find_string (void *cls)
877{ 870{
878 unsigned int search_peer = (unsigned int) (long) cls; 871 unsigned int search_peer = (unsigned int) (long) cls;
872 const struct GNUNET_SCHEDULER_TaskContext *tc;
879 873
874 tc = GNUNET_SCHEDULER_get_task_context ();
880 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) || 875 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) ||
881 search_peer >= num_peers || 876 search_peer >= num_peers ||
882 GNUNET_YES == in_shutdown) 877 GNUNET_YES == in_shutdown)
@@ -962,7 +957,7 @@ daemon_started (void *cls, struct GNUNET_TESTBED_Operation *op,
962 * @param tc the task context 957 * @param tc the task context
963 */ 958 */
964static void 959static void
965do_announce (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 960do_announce (void *cls)
966{ 961{
967 unsigned int i; 962 unsigned int i;
968 963
@@ -982,13 +977,14 @@ do_announce (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
982 * Start announcing the next regex in the DHT. 977 * Start announcing the next regex in the DHT.
983 * 978 *
984 * @param cls Closure (unused). 979 * @param cls Closure (unused).
985 * @param tc TaskContext.
986 */ 980 */
987static void 981static void
988announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 982announce_next_regex (void *cls)
989{ 983{
990 struct RegexPeer *peer; 984 struct RegexPeer *peer;
985 const struct GNUNET_SCHEDULER_TaskContext *tc;
991 986
987 tc = GNUNET_SCHEDULER_get_task_context ();
992 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 988 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
993 return; 989 return;
994 if (next_search >= num_peers) 990 if (next_search >= num_peers)