/*
This file is part of GNUnet.
- (C) 2009 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
* @file arm/test_exponential_backoff.c
/**
* Task set up to cancel the shutdown request on timeout.
*/
- GNUNET_SCHEDULER_TaskIdentifier cancel_task;
+ struct GNUNET_SCHEDULER_Task *cancel_task;
/**
* Task to call once shutdown complete
* Shutting down took too long, cancel receive and return error.
*
* @param cls closure
- * @param tc context information (why was this task triggered now)
*/
-void
-service_shutdown_cancel (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+static void
+service_shutdown_cancel (void *cls)
{
struct ShutdownContext *shutdown_ctx = cls;
{
struct ShutdownContext *shutdown_ctx;
- shutdown_ctx = GNUNET_malloc (sizeof (struct ShutdownContext));
+ shutdown_ctx = GNUNET_new (struct ShutdownContext);
shutdown_ctx->cont = cont;
shutdown_ctx->cont_cls = cont_cls;
shutdown_ctx->sock = sock;
static void
-kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc);
+kill_task (void *cbData);
static void
{
/* Re-try shutdown */
LOG ("do-nothing didn't die, trying again\n");
- GNUNET_SCHEDULER_add_now (kill_task, NULL);
+ GNUNET_SCHEDULER_add_now (&kill_task, NULL);
return;
}
startedWaitingAt = GNUNET_TIME_absolute_get ();
static void
-kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc)
+kill_task (void *cbData)
{
static struct GNUNET_CLIENT_Connection *doNothingConnection = NULL;
static void
-trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+trigger_disconnect (void *cls)
{
GNUNET_ARM_disconnect_and_free (arm);
GNUNET_ARM_monitor_disconnect_and_free (mon);
static void
-arm_stop_cb (void *cls, enum GNUNET_ARM_RequestStatus status, const char *servicename, enum GNUNET_ARM_Result result)
+arm_stop_cb (void *cls,
+ enum GNUNET_ARM_RequestStatus status,
+ const char *servicename,
+ enum GNUNET_ARM_Result result)
{
GNUNET_break (status == GNUNET_ARM_REQUEST_SENT_OK);
GNUNET_break (result == GNUNET_ARM_RESULT_STOPPED);
LOG ("ARM service stopped\n");
- GNUNET_SCHEDULER_add_now (trigger_disconnect, NULL);
+ GNUNET_SCHEDULER_add_now (&trigger_disconnect, NULL);
}
LOG ("do-nothing is starting\n");
phase++;
ok = 1;
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &kill_task, NULL);
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+ &kill_task, NULL);
}
else if ((phase == 2) && (strcasecmp (SERVICE, service) == 0))
{
if (status == GNUNET_ARM_SERVICE_STARTING)
{
LOG ("do-nothing is starting\n");
- GNUNET_SCHEDULER_add_now (kill_task, &ok);
+ GNUNET_SCHEDULER_add_now (&kill_task, &ok);
}
else if ((status == GNUNET_ARM_SERVICE_STOPPED) && (trialCount == 14))
{
task (void *cls, char *const *args, const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *c)
{
- char *armconfig;
cfg = c;
- if (NULL != cfgfile)
- {
- if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "arm",
- "CONFIG", &armconfig))
- {
- GNUNET_CONFIGURATION_set_value_string ((struct GNUNET_CONFIGURATION_Handle
- *) cfg, "arm", "CONFIG",
- cfgfile);
- }
- else
- GNUNET_free (armconfig);
- }
-
arm = GNUNET_ARM_connect (cfg, NULL, NULL);
if (NULL != arm)
{
}
+#ifndef PATH_MAX
+/**
+ * Assumed maximum path length (for the log file name).
+ */
+#define PATH_MAX 4096
+#endif
+
+
static int
init ()
{