diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-08-07 16:55:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-08-07 16:55:16 +0000 |
commit | b9de10a83f130b2c0a4513a1f713d778fbb4ecc1 (patch) | |
tree | 0dcfa912e2eea217d494ba56f1373e2c0cbb7e26 /src/datastore/perf_plugin_datastore.c | |
parent | d4115af6385dcab2433b27796e777819e297dae7 (diff) | |
download | gnunet-b9de10a83f130b2c0a4513a1f713d778fbb4ecc1.tar.gz gnunet-b9de10a83f130b2c0a4513a1f713d778fbb4ecc1.zip |
do not fail if datastore unavailable
Diffstat (limited to 'src/datastore/perf_plugin_datastore.c')
-rw-r--r-- | src/datastore/perf_plugin_datastore.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 660f256f9..17cd009bc 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -334,7 +334,13 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
334 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 334 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
335 | _("Loading `%s' datastore plugin\n"), name); | 335 | _("Loading `%s' datastore plugin\n"), name); |
336 | GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name); | 336 | GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name); |
337 | GNUNET_assert (NULL != (ret = GNUNET_PLUGIN_load (libname, &env))); | 337 | if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env))) |
338 | { | ||
339 | fprintf (stderr, | ||
340 | "Failed to load plugin `%s'!\n", | ||
341 | name); | ||
342 | return NULL; | ||
343 | } | ||
338 | GNUNET_free (libname); | 344 | GNUNET_free (libname); |
339 | GNUNET_free (name); | 345 | GNUNET_free (name); |
340 | return ret; | 346 | return ret; |
@@ -352,15 +358,19 @@ run (void *cls, | |||
352 | struct CpsRunContext *crc; | 358 | struct CpsRunContext *crc; |
353 | 359 | ||
354 | api = load_plugin (c, s); | 360 | api = load_plugin (c, s); |
355 | GNUNET_assert (api != NULL); | 361 | if (api == NULL) |
362 | { | ||
363 | fprintf (stderr, | ||
364 | "Could not initialize plugin, assuming database not configured. Test not run!\n"); | ||
365 | return; | ||
366 | } | ||
356 | crc = GNUNET_malloc(sizeof(struct CpsRunContext)); | 367 | crc = GNUNET_malloc(sizeof(struct CpsRunContext)); |
357 | crc->api = api; | 368 | crc->api = api; |
358 | crc->sched = s; | 369 | crc->sched = s; |
359 | crc->cfg = c; | 370 | crc->cfg = c; |
360 | crc->phase = RP_PUT; | 371 | crc->phase = RP_PUT; |
361 | GNUNET_SCHEDULER_add_after (s, | 372 | GNUNET_SCHEDULER_add_now (crc->sched, |
362 | GNUNET_SCHEDULER_NO_TASK, | 373 | &test, crc); |
363 | &test, crc); | ||
364 | } | 374 | } |
365 | 375 | ||
366 | 376 | ||