(unsigned int) max_path_compression,
stats_handle);
}
- /* Will result in a double first announce */
- GNUNET_assert (NULL != announce_handle);
- GNUNET_REGEX_reannounce (announce_handle);
+ else
+ {
+ GNUNET_assert (NULL != announce_handle);
+ GNUNET_REGEX_reannounce (announce_handle);
+ }
random_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
GNUNET_CRYPTO_random_u32 (
}
}
+/**
+ * Finish and free the operation used to start the regex daemon.
+ * operation_done calls ARM_disconnect, which cannot happen inside an
+ * ARM callback.
+ *
+ * @param cls Closure (Peer info)
+ * @param tc TaskContext
+ */
+static void
+arm_op_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct RegexPeer *peer = (struct RegexPeer *) cls;
+
+ GNUNET_TESTBED_operation_done (peer->op_handle);
+ peer->op_handle = NULL;
+}
+
static void
arm_start_cb (void *cls, struct GNUNET_ARM_Handle *arm,
enum GNUNET_ARM_RequestStatus rs, const char *service,
* Service is currently being started (due to client request).
*/
case GNUNET_ARM_RESULT_STARTING:
- GNUNET_TESTBED_operation_done (peer->op_handle);
- peer->op_handle = NULL;
+ GNUNET_SCHEDULER_add_now (&arm_op_done, peer);
if (peer_cnt < (num_peers - 1))
{