diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-25 14:46:27 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-10-25 14:46:27 +0000 |
commit | 95490c1cfb0ad832f7d93760bb16ad3151a191b8 (patch) | |
tree | 0ba63ae3fe17385e02a64861acdc6e7b28d8405c /src/ats-tool | |
parent | a7b5be23ee4646fc0a32198e7998e86850dd3576 (diff) | |
download | gnunet-95490c1cfb0ad832f7d93760bb16ad3151a191b8.tar.gz gnunet-95490c1cfb0ad832f7d93760bb16ad3151a191b8.zip |
monitor mode
Diffstat (limited to 'src/ats-tool')
-rw-r--r-- | src/ats-tool/gnunet-ats.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c index a443778a4..4c0134cfe 100644 --- a/src/ats-tool/gnunet-ats.c +++ b/src/ats-tool/gnunet-ats.c | |||
@@ -36,6 +36,7 @@ | |||
36 | static int ret; | 36 | static int ret; |
37 | static int results; | 37 | static int results; |
38 | static int resolve_addresses_numeric; | 38 | static int resolve_addresses_numeric; |
39 | static int monitor; | ||
39 | 40 | ||
40 | static struct GNUNET_ATS_PerformanceHandle *ph; | 41 | static struct GNUNET_ATS_PerformanceHandle *ph; |
41 | 42 | ||
@@ -147,7 +148,10 @@ void testservice_ats (void *cls, | |||
147 | if (NULL == ph) | 148 | if (NULL == ph) |
148 | fprintf (stderr, _("Cannot connect to ATS service, exiting...\n")); | 149 | fprintf (stderr, _("Cannot connect to ATS service, exiting...\n")); |
149 | 150 | ||
150 | end_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end, NULL); | 151 | if (GNUNET_NO == monitor) |
152 | end_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end, NULL); | ||
153 | else | ||
154 | end_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &end, NULL); | ||
151 | ret = 1; | 155 | ret = 1; |
152 | } | 156 | } |
153 | 157 | ||
@@ -165,7 +169,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
165 | { | 169 | { |
166 | cfg = (struct GNUNET_CONFIGURATION_Handle *) my_cfg; | 170 | cfg = (struct GNUNET_CONFIGURATION_Handle *) my_cfg; |
167 | GNUNET_CLIENT_service_test ("ats", cfg, | 171 | GNUNET_CLIENT_service_test ("ats", cfg, |
168 | GNUNET_TIME_UNIT_MINUTES, | 172 | TIMEOUT, |
169 | &testservice_ats, | 173 | &testservice_ats, |
170 | (void *) cfg); | 174 | (void *) cfg); |
171 | } | 175 | } |
@@ -183,11 +187,15 @@ main (int argc, char *const *argv) | |||
183 | { | 187 | { |
184 | int res; | 188 | int res; |
185 | resolve_addresses_numeric = GNUNET_NO; | 189 | resolve_addresses_numeric = GNUNET_NO; |
190 | monitor = GNUNET_NO; | ||
186 | 191 | ||
187 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 192 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
188 | {'n', "numeric", NULL, | 193 | {'n', "numeric", NULL, |
189 | gettext_noop ("do not resolve hostnames"), | 194 | gettext_noop ("do not resolve hostnames"), |
190 | 0, &GNUNET_GETOPT_set_one, &resolve_addresses_numeric}, | 195 | 0, &GNUNET_GETOPT_set_one, &resolve_addresses_numeric}, |
196 | {'m', "monitor", NULL, | ||
197 | gettext_noop ("monitor mode"), | ||
198 | 0, &GNUNET_GETOPT_set_one, &monitor}, | ||
191 | GNUNET_GETOPT_OPTION_END | 199 | GNUNET_GETOPT_OPTION_END |
192 | }; | 200 | }; |
193 | 201 | ||