[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r26424 - gnunet/src/regex
From: |
gnunet |
Subject: |
[GNUnet-SVN] r26424 - gnunet/src/regex |
Date: |
Thu, 14 Mar 2013 14:51:46 +0100 |
Author: bartpolot
Date: 2013-03-14 14:51:46 +0100 (Thu, 14 Mar 2013)
New Revision: 26424
Modified:
gnunet/src/regex/gnunet-daemon-regexprofiler.c
gnunet/src/regex/gnunet-regex-profiler.c
Log:
- fix arm_api crash
Modified: gnunet/src/regex/gnunet-daemon-regexprofiler.c
===================================================================
--- gnunet/src/regex/gnunet-daemon-regexprofiler.c 2013-03-14 13:46:14 UTC
(rev 26423)
+++ gnunet/src/regex/gnunet-daemon-regexprofiler.c 2013-03-14 13:51:46 UTC
(rev 26424)
@@ -151,9 +151,11 @@
(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 (
Modified: gnunet/src/regex/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/regex/gnunet-regex-profiler.c 2013-03-14 13:46:14 UTC (rev
26423)
+++ gnunet/src/regex/gnunet-regex-profiler.c 2013-03-14 13:51:46 UTC (rev
26424)
@@ -1048,7 +1048,24 @@
}
}
+/**
+ * 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,
enum GNUNET_ARM_Result result)
@@ -1074,8 +1091,7 @@
* 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))
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r26424 - gnunet/src/regex,
gnunet <=