[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16248 - gnunet/src/arm
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16248 - gnunet/src/arm |
Date: |
Wed, 27 Jul 2011 16:57:28 +0200 |
Author: nevans
Date: 2011-07-27 16:57:28 +0200 (Wed, 27 Jul 2011)
New Revision: 16248
Modified:
gnunet/src/arm/gnunet-arm.c
Log:
command line timeout option
Modified: gnunet/src/arm/gnunet-arm.c
===================================================================
--- gnunet/src/arm/gnunet-arm.c 2011-07-27 14:52:42 UTC (rev 16247)
+++ gnunet/src/arm/gnunet-arm.c 2011-07-27 14:57:28 UTC (rev 16248)
@@ -125,7 +125,12 @@
*/
static unsigned int phase;
+/**
+ * User defined timestamp for completing operations.
+ */
+static struct GNUNET_TIME_Relative timeout;
+
/**
* Main continuation-passing-style loop. Runs the various
* jobs that we've been asked to do in order.
@@ -291,35 +296,35 @@
case 0:
if (term != NULL)
{
- GNUNET_ARM_stop_service (h, term, STOP_TIMEOUT, &confirm_cb,
term);
+ GNUNET_ARM_stop_service (h, term, (0 == timeout.rel_value) ?
STOP_TIMEOUT : timeout, &confirm_cb, term);
return;
}
break;
case 1:
if ((end) || (restart))
{
- GNUNET_ARM_stop_service (h, "arm", STOP_TIMEOUT_ARM, &confirm_cb,
"arm");
+ GNUNET_ARM_stop_service (h, "arm", (0 == timeout.rel_value) ?
STOP_TIMEOUT_ARM : timeout, &confirm_cb, "arm");
return;
}
break;
case 2:
if (start)
{
- GNUNET_ARM_start_service (h, "arm", START_TIMEOUT, &confirm_cb,
"arm");
+ GNUNET_ARM_start_service (h, "arm", (0 == timeout.rel_value) ?
START_TIMEOUT : timeout, &confirm_cb, "arm");
return;
}
break;
case 3:
if (init != NULL)
{
- GNUNET_ARM_start_service (h, init, START_TIMEOUT, &confirm_cb,
init);
+ GNUNET_ARM_start_service (h, init, (0 == timeout.rel_value) ?
START_TIMEOUT : timeout, &confirm_cb, init);
return;
}
break;
case 4:
if (test != NULL)
{
- GNUNET_CLIENT_service_test (test, cfg, TEST_TIMEOUT,
&confirm_task, test);
+ GNUNET_CLIENT_service_test (test, cfg, (0 == timeout.rel_value) ?
TEST_TIMEOUT : timeout, &confirm_task, test);
return;
}
break;
@@ -363,6 +368,8 @@
int
main (int argc, char *const *argv)
{
+ static unsigned long long temp_timeout_ms;
+
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
{'e', "end", NULL, gettext_noop ("stop all GNUnet services"),
GNUNET_NO, &GNUNET_GETOPT_set_one, &end},
@@ -381,9 +388,14 @@
GNUNET_NO, &GNUNET_GETOPT_set_one, &delete},
{'q', "quiet", NULL, gettext_noop ("don't print status messages"),
GNUNET_NO, &GNUNET_GETOPT_set_one, &quiet},
+ {'T', "timeout", NULL, gettext_noop ("timeout for completing current
operation"),
+ GNUNET_NO, &GNUNET_GETOPT_set_one, &temp_timeout_ms},
GNUNET_GETOPT_OPTION_END
};
+ if (temp_timeout_ms > 0)
+ timeout.rel_value = temp_timeout_ms;
+
if (GNUNET_OK == GNUNET_PROGRAM_run (argc,
argv,
"gnunet-arm",
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16248 - gnunet/src/arm,
gnunet <=