diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-01-26 09:50:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-01-26 09:50:37 +0000 |
commit | ba007d1a80d1d376712d362881b17d64b36898d8 (patch) | |
tree | 60a19634db750591788057ae137b766aa4f034d0 /src/arm | |
parent | deec9d09189a4e2a2fd52468e9905dcf1b8d023d (diff) | |
download | gnunet-ba007d1a80d1d376712d362881b17d64b36898d8.tar.gz gnunet-ba007d1a80d1d376712d362881b17d64b36898d8.zip |
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.
Diffstat (limited to 'src/arm')
-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 ca4193837..1b17e2dfe 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c | |||
@@ -291,6 +291,7 @@ static void | |||
291 | run (void *cls, char *const *args, const char *cfgfile, | 291 | run (void *cls, char *const *args, const char *cfgfile, |
292 | const struct GNUNET_CONFIGURATION_Handle *c) | 292 | const struct GNUNET_CONFIGURATION_Handle *c) |
293 | { | 293 | { |
294 | char *armconfig; | ||
294 | cfg = c; | 295 | cfg = c; |
295 | config_file = cfgfile; | 296 | config_file = cfgfile; |
296 | if (GNUNET_CONFIGURATION_get_value_string | 297 | if (GNUNET_CONFIGURATION_get_value_string |
@@ -300,6 +301,18 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
300 | "PATHS", "SERVICEHOME"); | 301 | "PATHS", "SERVICEHOME"); |
301 | return; | 302 | return; |
302 | } | 303 | } |
304 | if (NULL != cfgfile) | ||
305 | { | ||
306 | if (GNUNET_OK != | ||
307 | GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG", | ||
308 | &armconfig)) | ||
309 | { | ||
310 | GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", | ||
311 | cfgfile); | ||
312 | } | ||
313 | else | ||
314 | GNUNET_free (armconfig); | ||
315 | } | ||
303 | if (NULL == (h = GNUNET_ARM_connect (cfg, NULL))) | 316 | if (NULL == (h = GNUNET_ARM_connect (cfg, NULL))) |
304 | { | 317 | { |
305 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 318 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
diff --git a/src/arm/test_arm_api.c b/src/arm/test_arm_api.c index e9bda410b..608c75cd3 100644 --- a/src/arm/test_arm_api.c +++ b/src/arm/test_arm_api.c | |||
@@ -118,7 +118,20 @@ static void | |||
118 | task (void *cls, char *const *args, const char *cfgfile, | 118 | task (void *cls, char *const *args, const char *cfgfile, |
119 | const struct GNUNET_CONFIGURATION_Handle *c) | 119 | const struct GNUNET_CONFIGURATION_Handle *c) |
120 | { | 120 | { |
121 | char *armconfig; | ||
121 | cfg = c; | 122 | cfg = c; |
123 | if (NULL != cfgfile) | ||
124 | { | ||
125 | if (GNUNET_OK != | ||
126 | GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG", | ||
127 | &armconfig)) | ||
128 | { | ||
129 | GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", | ||
130 | cfgfile); | ||
131 | } | ||
132 | else | ||
133 | GNUNET_free (armconfig); | ||
134 | } | ||
122 | arm = GNUNET_ARM_connect (cfg, NULL); | 135 | arm = GNUNET_ARM_connect (cfg, NULL); |
123 | #if START_ARM | 136 | #if START_ARM |
124 | GNUNET_ARM_start_service (arm, "arm", GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, &arm_notify, NULL); | 137 | 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 34ebad164..19ca58521 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c | |||
@@ -355,7 +355,20 @@ static void | |||
355 | task (void *cls, char *const *args, const char *cfgfile, | 355 | task (void *cls, char *const *args, const char *cfgfile, |
356 | const struct GNUNET_CONFIGURATION_Handle *c) | 356 | const struct GNUNET_CONFIGURATION_Handle *c) |
357 | { | 357 | { |
358 | char *armconfig; | ||
358 | cfg = c; | 359 | cfg = c; |
360 | if (NULL != cfgfile) | ||
361 | { | ||
362 | if (GNUNET_OK != | ||
363 | GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG", | ||
364 | &armconfig)) | ||
365 | { | ||
366 | GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", | ||
367 | cfgfile); | ||
368 | } | ||
369 | else | ||
370 | GNUNET_free (armconfig); | ||
371 | } | ||
359 | 372 | ||
360 | arm = GNUNET_ARM_connect (cfg, NULL); | 373 | arm = GNUNET_ARM_connect (cfg, NULL); |
361 | #if START_ARM | 374 | #if START_ARM |
diff --git a/src/arm/test_gnunet_service_arm.c b/src/arm/test_gnunet_service_arm.c index 98d8c6354..d367bc6fe 100644 --- a/src/arm/test_gnunet_service_arm.c +++ b/src/arm/test_gnunet_service_arm.c | |||
@@ -107,6 +107,20 @@ static void | |||
107 | run (void *cls, char *const *args, const char *cfgfile, | 107 | run (void *cls, char *const *args, const char *cfgfile, |
108 | const struct GNUNET_CONFIGURATION_Handle *c) | 108 | const struct GNUNET_CONFIGURATION_Handle *c) |
109 | { | 109 | { |
110 | char *armconfig; | ||
111 | |||
112 | if (NULL != cfgfile) | ||
113 | { | ||
114 | if (GNUNET_OK != | ||
115 | GNUNET_CONFIGURATION_get_value_filename (c, "arm", "CONFIG", | ||
116 | &armconfig)) | ||
117 | { | ||
118 | GNUNET_CONFIGURATION_set_value_string (c, "arm", "CONFIG", | ||
119 | cfgfile); | ||
120 | } | ||
121 | else | ||
122 | GNUNET_free (armconfig); | ||
123 | } | ||
110 | arm = GNUNET_ARM_connect (c, NULL); | 124 | arm = GNUNET_ARM_connect (c, NULL); |
111 | GNUNET_ARM_start_service (arm, "arm", | 125 | GNUNET_ARM_start_service (arm, "arm", |
112 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, | 126 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, |