exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 29fc3a651edbfa8061dc7b0664a54de7999ce5f2
parent ecdb2f903e08764288135f252ae3b6a44ed8e438
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  2 Apr 2026 01:16:45 +0200

-nicer logging for debugging

Diffstat:
Msrc/exchange/taler-exchange-httpd.c | 1-
Msrc/exchange/taler-exchange-httpd_get-kyc-check-H_NORMALIZED_PAYTO.c | 41+++++++++++++++++++++++++++++++++++------
Msrc/exchange/taler-exchange-httpd_get-reserves-RESERVE_PUB.c | 2++
Msrc/mhd/mhd_run.c | 2--
4 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c @@ -1885,7 +1885,6 @@ handle_mhd_request (void *cls, { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Handling new request\n"); - /* We're in a new async scope! */ rc = *con_cls = GNUNET_new (struct TEH_RequestContext); rc->start_time = GNUNET_TIME_absolute_get (); diff --git a/src/exchange/taler-exchange-httpd_get-kyc-check-H_NORMALIZED_PAYTO.c b/src/exchange/taler-exchange-httpd_get-kyc-check-H_NORMALIZED_PAYTO.c @@ -50,6 +50,11 @@ struct KycPoller struct KycPoller *prev; /** + * Our request context. + */ + struct TEH_RequestContext *rc; + + /** * Connection we are handling. */ struct MHD_Connection *connection; @@ -129,8 +134,15 @@ TEH_kyc_check_cleanup () kyp); if (kyp->suspended) { + struct GNUNET_AsyncScopeSave old_scope; + + GNUNET_async_scope_enter (&kyp->rc->async_scope_id, + &old_scope); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Resuming connection on shutdown\n"); kyp->suspended = false; MHD_resume_connection (kyp->connection); + GNUNET_async_scope_restore (&old_scope); } } } @@ -182,8 +194,6 @@ db_event_cb (void *cls, if (! kyp->suspended) return; /* event triggered while main transaction was still running, or got multiple wake-up events */ - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Received KYC update event\n"); kyp->suspended = false; GNUNET_async_scope_enter (&rc->async_scope_id, &old_scope); @@ -222,6 +232,7 @@ TEH_handler_kyc_check ( kyp = GNUNET_new (struct KycPoller); kyp->connection = rc->connection; + kyp->rc = rc; rc->rh_ctx = kyp; rc->rh_cleaner = &kyp_cleanup; @@ -290,8 +301,6 @@ TEH_handler_kyc_check ( .h_payto = kyp->h_payto }; - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Starting DB event listening for KYC COMPLETED\n"); kyp->eh = TEH_plugin->event_listen ( TEH_plugin->cls, GNUNET_TIME_absolute_get_remaining (kyp->timeout), @@ -352,6 +361,8 @@ TEH_handler_kyc_check ( (TALER_EXCHANGE_KLPT_KYC_OK != kyp->lpt) && (GNUNET_TIME_absolute_is_future (kyp->timeout)) ) { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Suspending due to account unknown!\n"); do_suspend = true; access_ok = true; /* for now */ } @@ -359,9 +370,10 @@ TEH_handler_kyc_check ( else { GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Found rule %llu (client wants > %llu)\n", + "Found rule %llu (client wants > %llu, %d)\n", (unsigned long long) rule_gen, - (unsigned long long) kyp->min_rule); + (unsigned long long) kyp->min_rule, + (int) kyp->lpt); access_ok = ( (! GNUNET_is_zero (&kyp->account_pub) && (GNUNET_OK == @@ -378,19 +390,33 @@ TEH_handler_kyc_check ( { case TALER_EXCHANGE_KLPT_NONE: /* If KLPT is not given, just go for rule generation */ + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Suspending until rule generation changes\n"); do_suspend = true; break; case TALER_EXCHANGE_KLPT_KYC_AUTH_TRANSFER: if (! access_ok) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Waiting for auth transfer, access NOT OK, suspending again\n"); do_suspend = true; + } break; case TALER_EXCHANGE_KLPT_INVESTIGATION_DONE: if (! aml_review) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Waiting for investigation complete, investigation ongoing, suspending again\n"); do_suspend = true; + } break; case TALER_EXCHANGE_KLPT_KYC_OK: if (kyc_required) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Waiting for KYC OK, but KYC NOT OK, suspending again\n"); do_suspend = true; + } break; } } @@ -407,10 +433,13 @@ TEH_handler_kyc_check ( true), (int) kyp->lpt); GNUNET_assert (NULL != kyp->eh); + GNUNET_assert (! kyp->suspended); kyp->suspended = true; GNUNET_CONTAINER_DLL_insert (kyp_head, kyp_tail, kyp); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Telling MHD to suspend connection\n"); MHD_suspend_connection (kyp->connection); return MHD_YES; } diff --git a/src/exchange/taler-exchange-httpd_get-reserves-RESERVE_PUB.c b/src/exchange/taler-exchange-httpd_get-reserves-RESERVE_PUB.c @@ -167,6 +167,8 @@ db_event_cb (void *cls, return; /* might get multiple wake-up events */ GNUNET_async_scope_enter (&rp->rc->async_scope_id, &old_scope); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Resuming from long-polling on KYC status\n"); TEH_check_invariants (); rp->suspended = false; MHD_resume_connection (rp->connection); diff --git a/src/mhd/mhd_run.c b/src/mhd/mhd_run.c @@ -141,8 +141,6 @@ prepare_daemon (struct DaemonEntry *de) GNUNET_NETWORK_fdset_copy_native (wws, &ws, max + 1); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Adding run_daemon select task\n"); de->mhd_task = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH, tv,