static int ret;
+static struct GNUNET_SCHEDULER_Task *tt;
+
static void
result_cb_set1 (void *cls,
fprintf (stderr,
"set 1: received failure status!\n");
ret = 1;
+ GNUNET_SCHEDULER_cancel (tt);
+ tt = NULL;
GNUNET_SCHEDULER_shutdown ();
break;
case GNUNET_SET_STATUS_DONE:
GNUNET_SET_destroy (set1);
set1 = NULL;
if (NULL == set2)
+ {
+ GNUNET_SCHEDULER_cancel (tt);
+ tt = NULL;
GNUNET_SCHEDULER_shutdown ();
+ }
break;
default:
GNUNET_assert (0);
GNUNET_SET_destroy (set2);
set2 = NULL;
if (NULL == set1)
+ {
+ GNUNET_SCHEDULER_cancel (tt);
+ tt = NULL;
GNUNET_SCHEDULER_shutdown ();
+ }
break;
default:
GNUNET_assert (0);
* Signature of the main function of a task.
*
* @param cls closure
- * @param tc context information (why was this task triggered now)
*/
static void
-timeout_fail (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+timeout_fail (void *cls)
{
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
+ tt = NULL;
GNUNET_SCHEDULER_shutdown ();
ret = 1;
}
struct GNUNET_SET_OperationHandle *my_oh;
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5),
- &timeout_fail, NULL);
+ tt = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5),
+ &timeout_fail, NULL);
config = cfg;
GNUNET_CRYPTO_get_peer_identity (cfg, &local_id);
}
return ret;
}
-