diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-01-26 09:50:37 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-01-26 09:50:37 +0000 |
commit | bf47666c0dfb80a031d64234a5cd7c6bf3ee01f2 (patch) | |
tree | 60a19634db750591788057ae137b766aa4f034d0 | |
parent | 4a3d191b07338c8e22b28c102ce85c5fa3623c24 (diff) |
LRN: Here's a patch. See if it doesn't break anything for you.
Arm service is started with -c <configname> only when the process that
runs arm service has "[arm]/CONFIG" defined in the configuration used
to run arm service (usually - process' own configuration).
Since default [arm] config has no CONFIG defined anymore (thanks to
your r25908), we need to add this code to put the config file that was
passed to gnunet-arm tool via -c as "[arm]/CONFIG" for arm service to
receive it.
Otherwise arm service is run without config and reads default config
(~/.gnunet/gnunet.conf) instead, which is clearly not what we need.
git-svn-id: https://gnunet.org/svn/gnunet@25919 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r-- | src/arm/gnunet-arm.c | 13 | ||||
-rw-r--r-- | src/arm/test_arm_api.c | 13 | ||||
-rw-r--r-- | src/arm/test_exponential_backoff.c | 13 | ||||
-rw-r--r-- | src/arm/test_gnunet_service_arm.c | 14 |
4 files changed, 53 insertions, 0 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index ca4193837e..1b17e2dfea 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c @@ -291,6 +291,7 @@ static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { + char *armconfig; cfg = c; config_file = cfgfile; if (GNUNET_CONFIGURATION_get_value_string @@ -300,6 +301,18 @@ run (void *cls, char *const *args, const char *cfgfile, "PATHS", "SERVICEHOME"); return; } + if (NULL != cfgfile) + { + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG", + &armconfig)) + { + GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", + cfgfile); + } + else + GNUNET_free (armconfig); + } if (NULL == (h = GNUNET_ARM_connect (cfg, NULL))) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, diff --git a/src/arm/test_arm_api.c b/src/arm/test_arm_api.c index e9bda410b0..608c75cd34 100644 --- a/src/arm/test_arm_api.c +++ b/src/arm/test_arm_api.c @@ -118,7 +118,20 @@ static void 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 (cfg, "arm", "CONFIG", + cfgfile); + } + else + GNUNET_free (armconfig); + } arm = GNUNET_ARM_connect (cfg, NULL); #if START_ARM GNUNET_ARM_start_service (arm, "arm", GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, &arm_notify, NULL); diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c index 34ebad1644..19ca585211 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c @@ -355,7 +355,20 @@ static void 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 (cfg, "arm", "CONFIG", + cfgfile); + } + else + GNUNET_free (armconfig); + } arm = GNUNET_ARM_connect (cfg, NULL); #if START_ARM diff --git a/src/arm/test_gnunet_service_arm.c b/src/arm/test_gnunet_service_arm.c index 98d8c6354f..d367bc6fef 100644 --- a/src/arm/test_gnunet_service_arm.c +++ b/src/arm/test_gnunet_service_arm.c @@ -107,6 +107,20 @@ static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { + char *armconfig; + + if (NULL != cfgfile) + { + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_filename (c, "arm", "CONFIG", + &armconfig)) + { + GNUNET_CONFIGURATION_set_value_string (c, "arm", "CONFIG", + cfgfile); + } + else + GNUNET_free (armconfig); + } arm = GNUNET_ARM_connect (c, NULL); GNUNET_ARM_start_service (arm, "arm", GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, |