diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-23 00:00:32 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-23 00:00:32 +0200 |
commit | c559b1c935a93c4cdec442beeac59264d483c824 (patch) | |
tree | 625cf48e047e6534606b5b6b9cd0c15f4c3672dc /src/auditor/report-lib.c | |
parent | 37f049b3bc98c72f68687e67f102ee5b06f9263d (diff) |
complete implementation of long-polling for reserve status; remove support for multi-threaded exchange httpd
Diffstat (limited to 'src/auditor/report-lib.c')
-rw-r--r-- | src/auditor/report-lib.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c index 5f45d7198..0ae1cc1f6 100644 --- a/src/auditor/report-lib.c +++ b/src/auditor/report-lib.c @@ -42,11 +42,6 @@ struct TALER_Amount TALER_ARL_currency_round_unit; const struct GNUNET_CONFIGURATION_Handle *TALER_ARL_cfg; /** - * Our session with the #TALER_ARL_edb. - */ -struct TALER_EXCHANGEDB_Session *TALER_ARL_esession; - -/** * Handle to access the auditor's database. */ struct TALER_AUDITORDB_Plugin *TALER_ARL_adb; @@ -213,7 +208,6 @@ TALER_ARL_get_denomination_info_by_hash ( denominations = GNUNET_CONTAINER_multihashmap_create (256, GNUNET_NO); qs = TALER_ARL_edb->iterate_denomination_info (TALER_ARL_edb->cls, - TALER_ARL_esession, &add_denomination, NULL); if (0 > qs) @@ -239,7 +233,6 @@ TALER_ARL_get_denomination_info_by_hash ( struct TALER_EXCHANGEDB_DenominationKeyInformationP issue; qs = TALER_ARL_edb->get_denomination_info (TALER_ARL_edb->cls, - TALER_ARL_esession, dh, &issue); if (qs <= 0) @@ -324,23 +317,24 @@ transact (TALER_ARL_Analysis analysis, GNUNET_break (0); return GNUNET_SYSERR; } - TALER_ARL_edb->preflight (TALER_ARL_edb->cls, - TALER_ARL_esession); + if (GNUNET_OK != + TALER_ARL_edb->preflight (TALER_ARL_edb->cls)) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } ret = TALER_ARL_edb->start (TALER_ARL_edb->cls, - TALER_ARL_esession, "auditor"); if (GNUNET_OK != ret) { GNUNET_break (0); - TALER_ARL_edb->rollback (TALER_ARL_edb->cls, - TALER_ARL_esession); + TALER_ARL_edb->rollback (TALER_ARL_edb->cls); return GNUNET_SYSERR; } qs = analysis (analysis_cls); if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == qs) { - qs = TALER_ARL_edb->commit (TALER_ARL_edb->cls, - TALER_ARL_esession); + qs = TALER_ARL_edb->commit (TALER_ARL_edb->cls); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); @@ -367,8 +361,7 @@ transact (TALER_ARL_Analysis analysis, "Processing failed (or no changes), rolling back transaction\n"); TALER_ARL_adb->rollback (TALER_ARL_adb->cls, TALER_ARL_asession); - TALER_ARL_edb->rollback (TALER_ARL_edb->cls, - TALER_ARL_esession); + TALER_ARL_edb->rollback (TALER_ARL_edb->cls); } switch (qs) { @@ -396,11 +389,11 @@ int TALER_ARL_setup_sessions_and_run (TALER_ARL_Analysis ana, void *ana_cls) { - TALER_ARL_esession = TALER_ARL_edb->get_session (TALER_ARL_edb->cls); - if (NULL == TALER_ARL_esession) + if (GNUNET_OK != + TALER_ARL_edb->preflight (TALER_ARL_edb->cls)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Failed to initialize exchange session.\n"); + "Failed to initialize exchange connection.\n"); return GNUNET_SYSERR; } TALER_ARL_asession = TALER_ARL_adb->get_session (TALER_ARL_adb->cls); |