donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit a4bf5c46d314decbab9dfcf9943847cad00e0cf1
parent 52b0b5f287e423149aed4c435898278e7ac44193
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sun, 19 Jul 2026 23:54:13 +0200

handle HTTP status codes as per spec

Diffstat:
Msrc/donau/donau-httpd_post-batch-submit.c | 3++-
Msrc/lib/donau_api_batch_submit_receipts.c | 12+++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/donau/donau-httpd_post-batch-submit.c b/src/donau/donau-httpd_post-batch-submit.c @@ -226,7 +226,8 @@ DH_handler_post_batch_submit (struct DH_RequestContext *rc, &udi_hash); /* Check signature*/ - if (GNUNET_OK != DONAU_donation_receipt_verify ( + if (GNUNET_OK != + DONAU_donation_receipt_verify ( &dk->donation_unit_pub, &udi_hash, &irc.donation_receipts[i].donation_unit_sig)) diff --git a/src/lib/donau_api_batch_submit_receipts.c b/src/lib/donau_api_batch_submit_receipts.c @@ -133,24 +133,26 @@ handle_batch_submit_finished (void *cls, birh->job = NULL; switch (response_code) { - case MHD_HTTP_OK: + case MHD_HTTP_CREATED: + /* Success: a donation statement is now available (empty body). */ break; - case MHD_HTTP_NO_CONTENT: + case MHD_HTTP_CONFLICT: + /* A duplicate donor identifier nonce was detected. */ biresp.hr.ec = TALER_JSON_get_error_code (j); biresp.hr.hint = TALER_JSON_get_error_hint (j); break; - // One of the signatures is invalid. case MHD_HTTP_FORBIDDEN: + /* One of the signatures is invalid. */ biresp.hr.ec = TALER_JSON_get_error_code (j); biresp.hr.hint = TALER_JSON_get_error_hint (j); break; - // At least one of the donation unit keys is not known to the Donau. case MHD_HTTP_NOT_FOUND: + /* At least one of the donation unit keys is not known to the Donau. */ biresp.hr.ec = TALER_JSON_get_error_code (j); biresp.hr.hint = TALER_JSON_get_error_hint (j); break; - // At least one of the corresponding private keys is deprecated/leaked. case MHD_HTTP_GONE: + /* At least one of the corresponding private keys is deprecated/leaked. */ biresp.hr.ec = TALER_JSON_get_error_code (j); biresp.hr.hint = TALER_JSON_get_error_hint (j); break;