diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-03-14 13:51:46 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-03-14 13:51:46 +0000 |
commit | e7952b62750bbebe5c4203da6b42da4ac34d35b3 (patch) | |
tree | 8b7bdf7e428b4c9584576af2a17b6480ab57ff74 /src/regex | |
parent | fcba8b93e2564cfb9246083d06e697753f792d82 (diff) | |
download | gnunet-e7952b62750bbebe5c4203da6b42da4ac34d35b3.tar.gz gnunet-e7952b62750bbebe5c4203da6b42da4ac34d35b3.zip |
- fix arm_api crash
Diffstat (limited to 'src/regex')
-rw-r--r-- | src/regex/gnunet-daemon-regexprofiler.c | 8 | ||||
-rw-r--r-- | src/regex/gnunet-regex-profiler.c | 20 |
2 files changed, 23 insertions, 5 deletions
diff --git a/src/regex/gnunet-daemon-regexprofiler.c b/src/regex/gnunet-daemon-regexprofiler.c index fd6a97d07..711f7fa42 100644 --- a/src/regex/gnunet-daemon-regexprofiler.c +++ b/src/regex/gnunet-daemon-regexprofiler.c | |||
@@ -151,9 +151,11 @@ reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
151 | (unsigned int) max_path_compression, | 151 | (unsigned int) max_path_compression, |
152 | stats_handle); | 152 | stats_handle); |
153 | } | 153 | } |
154 | /* Will result in a double first announce */ | 154 | else |
155 | GNUNET_assert (NULL != announce_handle); | 155 | { |
156 | GNUNET_REGEX_reannounce (announce_handle); | 156 | GNUNET_assert (NULL != announce_handle); |
157 | GNUNET_REGEX_reannounce (announce_handle); | ||
158 | } | ||
157 | 159 | ||
158 | random_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 160 | random_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
159 | GNUNET_CRYPTO_random_u32 ( | 161 | GNUNET_CRYPTO_random_u32 ( |
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c index 0f9574c8b..029ea5b94 100644 --- a/src/regex/gnunet-regex-profiler.c +++ b/src/regex/gnunet-regex-profiler.c | |||
@@ -1048,6 +1048,23 @@ arm_da (void *cls, void *op_result) | |||
1048 | } | 1048 | } |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | /** | ||
1052 | * Finish and free the operation used to start the regex daemon. | ||
1053 | * operation_done calls ARM_disconnect, which cannot happen inside an | ||
1054 | * ARM callback. | ||
1055 | * | ||
1056 | * @param cls Closure (Peer info) | ||
1057 | * @param tc TaskContext | ||
1058 | */ | ||
1059 | static void | ||
1060 | arm_op_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1061 | { | ||
1062 | struct RegexPeer *peer = (struct RegexPeer *) cls; | ||
1063 | |||
1064 | GNUNET_TESTBED_operation_done (peer->op_handle); | ||
1065 | peer->op_handle = NULL; | ||
1066 | } | ||
1067 | |||
1051 | static void | 1068 | static void |
1052 | arm_start_cb (void *cls, struct GNUNET_ARM_Handle *arm, | 1069 | arm_start_cb (void *cls, struct GNUNET_ARM_Handle *arm, |
1053 | enum GNUNET_ARM_RequestStatus rs, const char *service, | 1070 | enum GNUNET_ARM_RequestStatus rs, const char *service, |
@@ -1074,8 +1091,7 @@ arm_start_cb (void *cls, struct GNUNET_ARM_Handle *arm, | |||
1074 | * Service is currently being started (due to client request). | 1091 | * Service is currently being started (due to client request). |
1075 | */ | 1092 | */ |
1076 | case GNUNET_ARM_RESULT_STARTING: | 1093 | case GNUNET_ARM_RESULT_STARTING: |
1077 | GNUNET_TESTBED_operation_done (peer->op_handle); | 1094 | GNUNET_SCHEDULER_add_now (&arm_op_done, peer); |
1078 | peer->op_handle = NULL; | ||
1079 | 1095 | ||
1080 | if (peer_cnt < (num_peers - 1)) | 1096 | if (peer_cnt < (num_peers - 1)) |
1081 | { | 1097 | { |