exchange

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

commit bf7964857d5c206c2f03f0f92bc75279ddd4a789
parent 7011826dbe571327324c1a7b6a5259aa26da6bbe
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue,  7 Apr 2026 10:55:31 +0200

fix inconsistent use of 'found' for 'see_other'

Diffstat:
Mcontrib/microhttpd.tag | 6++++++
Msrc/include/taler/taler-exchange/get-kyc-proof-PROVIDER_NAME.h | 4++--
Msrc/lib/exchange_api_get-kyc-proof-PROVIDER_NAME.c | 44++++++++++++++++++++++++++++----------------
Msrc/testing/testing_api_cmd_kyc_proof.c | 2+-
4 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/contrib/microhttpd.tag b/contrib/microhttpd.tag @@ -100,6 +100,12 @@ </member> <member kind="define"> <type>#define</type> + <name>MHD_HTTP_SEE_OTHER</name> + <anchorfile>microhttpd.h</anchorfile> + <arglist></arglist> + </member> + <member kind="define"> + <type>#define</type> <name>MHD_HTTP_CREATED</name> <anchorfile>microhttpd.h</anchorfile> <arglist></arglist> diff --git a/src/include/taler/taler-exchange/get-kyc-proof-PROVIDER_NAME.h b/src/include/taler/taler-exchange/get-kyc-proof-PROVIDER_NAME.h @@ -182,7 +182,7 @@ struct TALER_EXCHANGE_GetKycProofResponse union { /** - * Details on #MHD_HTTP_FOUND (redirect). + * Details on #MHD_HTTP_SEE_OTHER (redirect). */ struct { @@ -191,7 +191,7 @@ struct TALER_EXCHANGE_GetKycProofResponse */ const char *redirect_url; - } found; + } see_other; } details; diff --git a/src/lib/exchange_api_get-kyc-proof-PROVIDER_NAME.c b/src/lib/exchange_api_get-kyc-proof-PROVIDER_NAME.c @@ -130,7 +130,7 @@ handle_get_kyc_proof_finished (void *cls, curl_easy_getinfo (gkph->eh, CURLINFO_REDIRECT_URL, &redirect_url)); - gkpr.details.found.redirect_url = redirect_url; + gkpr.details.see_other.redirect_url = redirect_url; break; } case MHD_HTTP_BAD_REQUEST: @@ -215,8 +215,6 @@ TALER_EXCHANGE_get_kyc_proof_start ( TALER_EXCHANGE_GetKycProofCallback cb, TALER_EXCHANGE_GET_KYC_PROOF_RESULT_CLOSURE *cb_cls) { - char *arg_str; - if (NULL != gkph->job) { GNUNET_break (0); @@ -226,31 +224,46 @@ TALER_EXCHANGE_get_kyc_proof_start ( gkph->cb_cls = cb_cls; { char hstr[sizeof (gkph->h_payto) * 2]; + char *arg_str; char *end; + char *url; + GNUNET_asprintf (&arg_str, + "kyc-proof/%s", + gkph->logic); end = GNUNET_STRINGS_data_to_string (&gkph->h_payto, sizeof (gkph->h_payto), hstr, sizeof (hstr)); *end = '\0'; - GNUNET_asprintf (&arg_str, - "kyc-proof/%s?state=%s%s", - gkph->logic, - hstr, - (NULL != gkph->args) ? gkph->args : ""); + url = TALER_url_join (gkph->base_url, + arg_str, + "state", hstr, + NULL); + GNUNET_free (arg_str); + if (NULL == url) + { + GNUNET_break (0); + return TALER_EC_GENERIC_CONFIGURATION_INVALID; + } + if (NULL != gkph->args) + { + GNUNET_asprintf (&gkph->url, + "%s%s", + url, + gkph->args); + GNUNET_free (url); + } + else + { + gkph->url = url; + } } - gkph->url = TALER_url_join (gkph->base_url, - arg_str, - NULL); - GNUNET_free (arg_str); - if (NULL == gkph->url) - return TALER_EC_GENERIC_CONFIGURATION_INVALID; gkph->eh = TALER_EXCHANGE_curl_easy_get_ (gkph->url); if (NULL == gkph->eh) { GNUNET_break (0); GNUNET_free (gkph->url); - gkph->url = NULL; return TALER_EC_GENERIC_CONFIGURATION_INVALID; } /* disable location following, we want to learn the @@ -268,7 +281,6 @@ TALER_EXCHANGE_get_kyc_proof_start ( curl_easy_cleanup (gkph->eh); gkph->eh = NULL; GNUNET_free (gkph->url); - gkph->url = NULL; return TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE; } return TALER_EC_NONE; diff --git a/src/testing/testing_api_cmd_kyc_proof.c b/src/testing/testing_api_cmd_kyc_proof.c @@ -110,7 +110,7 @@ proof_kyc_cb ( switch (kpr->hr.http_status) { case MHD_HTTP_SEE_OTHER: - kcg->redirect_url = GNUNET_strdup (kpr->details.found.redirect_url); + kcg->redirect_url = GNUNET_strdup (kpr->details.see_other.redirect_url); break; case MHD_HTTP_FORBIDDEN: break;