diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-03-19 13:53:50 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-03-19 13:53:50 +0000 |
commit | b7c97d0ef3729107a38b6ba3ec7f05407a52ae01 (patch) | |
tree | 77038aab5594b24d07da78f2717aed744aee334d /src/regex | |
parent | d89cc5614983e07b13bcf9dfaf7f3b0701455ac5 (diff) | |
download | gnunet-b7c97d0ef3729107a38b6ba3ec7f05407a52ae01.tar.gz gnunet-b7c97d0ef3729107a38b6ba3ec7f05407a52ae01.zip |
- fix use of search_index on start
Diffstat (limited to 'src/regex')
-rw-r--r-- | src/regex/gnunet-regex-profiler.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c index cc8d5af6b..3de352c66 100644 --- a/src/regex/gnunet-regex-profiler.c +++ b/src/regex/gnunet-regex-profiler.c | |||
@@ -1088,7 +1088,6 @@ arm_start_cb (void *cls, struct GNUNET_ARM_Handle *arm, | |||
1088 | case GNUNET_ARM_RESULT_STARTING: | 1088 | case GNUNET_ARM_RESULT_STARTING: |
1089 | GNUNET_SCHEDULER_add_now (&arm_op_done, peer); | 1089 | GNUNET_SCHEDULER_add_now (&arm_op_done, peer); |
1090 | 1090 | ||
1091 | if (search_index < (num_peers - 1)) | ||
1092 | { | 1091 | { |
1093 | long search_peer; | 1092 | long search_peer; |
1094 | unsigned int i = 0; | 1093 | unsigned int i = 0; |
@@ -1107,13 +1106,10 @@ arm_start_cb (void *cls, struct GNUNET_ARM_Handle *arm, | |||
1107 | &find_string, | 1106 | &find_string, |
1108 | (void *) search_peer); | 1107 | (void *) search_peer); |
1109 | } | 1108 | } |
1110 | else | 1109 | if (search_index == (num_peers - 1) && |
1110 | GNUNET_SCHEDULER_NO_TASK == search_timeout_task) | ||
1111 | { | 1111 | { |
1112 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1112 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "All daemons started.\n"); |
1113 | "All daemons started." | ||
1114 | " Waiting %s to start string searches\n", | ||
1115 | GNUNET_STRINGS_relative_time_to_string (search_delay, | ||
1116 | GNUNET_NO)); | ||
1117 | /* FIXME start GLOBAL timeout to abort experiment */ | 1113 | /* FIXME start GLOBAL timeout to abort experiment */ |
1118 | search_timeout_task = GNUNET_SCHEDULER_add_delayed (search_timeout_time, | 1114 | search_timeout_task = GNUNET_SCHEDULER_add_delayed (search_timeout_time, |
1119 | &search_timeout, | 1115 | &search_timeout, |
@@ -1170,10 +1166,17 @@ arm_connect_cb (void *cls, struct GNUNET_TESTBED_Operation *op, | |||
1170 | static void | 1166 | static void |
1171 | do_announce (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1167 | do_announce (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
1172 | { | 1168 | { |
1169 | unsigned int i; | ||
1170 | |||
1173 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting announce.\n"); | 1171 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting announce.\n"); |
1174 | 1172 | ||
1175 | for (search_index = 0; search_index < SEARCHES_IN_PARALLEL; search_index++) | 1173 | for (i = 0; i < SEARCHES_IN_PARALLEL; i++) |
1174 | { | ||
1175 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
1176 | " scheduling announce %u\n", | ||
1177 | i); | ||
1176 | (void) GNUNET_SCHEDULER_add_now (&announce_next_regex, NULL); | 1178 | (void) GNUNET_SCHEDULER_add_now (&announce_next_regex, NULL); |
1179 | } | ||
1177 | } | 1180 | } |
1178 | 1181 | ||
1179 | 1182 | ||
@@ -1186,7 +1189,8 @@ do_announce (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1186 | static void | 1189 | static void |
1187 | announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1190 | announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
1188 | { | 1191 | { |
1189 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1192 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) || |
1193 | search_index >= num_peers) | ||
1190 | return; | 1194 | return; |
1191 | 1195 | ||
1192 | /* First connect to arm service, then announce. Next | 1196 | /* First connect to arm service, then announce. Next |
@@ -1201,6 +1205,7 @@ announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1201 | &arm_ca, | 1205 | &arm_ca, |
1202 | &arm_da, | 1206 | &arm_da, |
1203 | &peers[search_index]); | 1207 | &peers[search_index]); |
1208 | search_index++; | ||
1204 | parallel_searches++; | 1209 | parallel_searches++; |
1205 | } | 1210 | } |
1206 | 1211 | ||
@@ -1626,7 +1631,7 @@ controller_event_cb (void *cls, | |||
1626 | { | 1631 | { |
1627 | prof_time = GNUNET_TIME_absolute_get_duration (prof_start_time); | 1632 | prof_time = GNUNET_TIME_absolute_get_duration (prof_start_time); |
1628 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1633 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1629 | "\n%u links established in %s\n", | 1634 | "%u links established in %s\n", |
1630 | num_links, | 1635 | num_links, |
1631 | GNUNET_STRINGS_relative_time_to_string (prof_time, | 1636 | GNUNET_STRINGS_relative_time_to_string (prof_time, |
1632 | GNUNET_NO)); | 1637 | GNUNET_NO)); |