exchange

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

commit 05115940eb44db255483cafeeb509c56c2ec8fd2
parent 5e2ea92480df4b1887c027251f11a9b8fa767dbc
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Tue, 11 Mar 2025 00:34:34 +0100

Revert "fix: broken build" -- please update your GNUnet.

This reverts commit 5e2ea92480df4b1887c027251f11a9b8fa767dbc.

Diffstat:
Msrc/bank-lib/Makefile.am | 1+
Msrc/bank-lib/fakebank_bank_post_accounts_token.c | 27++++++++++++++-------------
Msrc/bank-lib/fakebank_bank_post_accounts_withdrawals.c | 27++++++++++++++-------------
Msrc/bank-lib/fakebank_bank_post_withdrawals_id_op.c | 27++++++++++++++-------------
Msrc/bank-lib/fakebank_bank_testing_register.c | 27++++++++++++++-------------
Msrc/bank-lib/fakebank_tbi_post_withdrawal_operation.c | 27++++++++++++++-------------
Msrc/bank-lib/fakebank_twg_admin_add_incoming.c | 27++++++++++++++-------------
Msrc/bank-lib/fakebank_twg_admin_add_kycauth.c | 27++++++++++++++-------------
Msrc/bank-lib/fakebank_twg_transfer.c | 27++++++++++++++-------------
Msrc/mhd/Makefile.am | 1+
Msrc/mhd/mhd_parsing.c | 29+++++++++++++++--------------
11 files changed, 129 insertions(+), 118 deletions(-)

diff --git a/src/bank-lib/Makefile.am b/src/bank-lib/Makefile.am @@ -51,6 +51,7 @@ libtalerbank_la_LIBADD = \ $(top_builddir)/src/util/libtalerutil.la \ -lgnunetcurl \ -lgnunetjson \ + -lgnunetmhd \ -lgnunetutil \ -ljansson \ -lcurl \ diff --git a/src/bank-lib/fakebank_bank_post_accounts_token.c b/src/bank-lib/fakebank_bank_post_accounts_token.c @@ -27,6 +27,7 @@ #include "taler_bank_service.h" #include "taler_mhd_lib.h" #include <gnunet/gnunet_mhd_compat.h> +#include <gnunet/gnunet_mhd_lib.h> #include "fakebank.h" #include "fakebank_bank_post_accounts_token.h" #include "fakebank_common_lookup.h" @@ -118,36 +119,36 @@ TALER_FAKEBANK_bank_post_accounts_token_ ( void **con_cls) { struct ConnectionContext *cc = *con_cls; - enum GNUNET_JSON_PostResult pr; + enum GNUNET_MHD_PostResult pr; json_t *json; MHD_RESULT res; if (NULL == cc) { cc = GNUNET_new (struct ConnectionContext); - cc->ctx_cleaner = &GNUNET_JSON_post_parser_cleanup; + cc->ctx_cleaner = &GNUNET_MHD_post_parser_cleanup; *con_cls = cc; } - pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX, - connection, - &cc->ctx, - upload_data, - upload_data_size, - &json); + pr = GNUNET_MHD_post_parser (REQUEST_BUFFER_MAX, + connection, + &cc->ctx, + upload_data, + upload_data_size, + &json); switch (pr) { - case GNUNET_JSON_PR_OUT_OF_MEMORY: + case GNUNET_MHD_PR_OUT_OF_MEMORY: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_CONTINUE: + case GNUNET_MHD_PR_CONTINUE: return MHD_YES; - case GNUNET_JSON_PR_REQUEST_TOO_LARGE: + case GNUNET_MHD_PR_REQUEST_TOO_LARGE: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_JSON_INVALID: + case GNUNET_MHD_PR_JSON_INVALID: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_SUCCESS: + case GNUNET_MHD_PR_SUCCESS: break; } diff --git a/src/bank-lib/fakebank_bank_post_accounts_withdrawals.c b/src/bank-lib/fakebank_bank_post_accounts_withdrawals.c @@ -27,6 +27,7 @@ #include "taler_bank_service.h" #include "taler_mhd_lib.h" #include <gnunet/gnunet_mhd_compat.h> +#include <gnunet/gnunet_mhd_lib.h> #include "fakebank.h" #include "fakebank_bank_post_accounts_withdrawals.h" #include "fakebank_common_lookup.h" @@ -141,36 +142,36 @@ TALER_FAKEBANK_bank_post_account_withdrawals_ ( void **con_cls) { struct ConnectionContext *cc = *con_cls; - enum GNUNET_JSON_PostResult pr; + enum GNUNET_MHD_PostResult pr; json_t *json; MHD_RESULT res; if (NULL == cc) { cc = GNUNET_new (struct ConnectionContext); - cc->ctx_cleaner = &GNUNET_JSON_post_parser_cleanup; + cc->ctx_cleaner = &GNUNET_MHD_post_parser_cleanup; *con_cls = cc; } - pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX, - connection, - &cc->ctx, - upload_data, - upload_data_size, - &json); + pr = GNUNET_MHD_post_parser (REQUEST_BUFFER_MAX, + connection, + &cc->ctx, + upload_data, + upload_data_size, + &json); switch (pr) { - case GNUNET_JSON_PR_OUT_OF_MEMORY: + case GNUNET_MHD_PR_OUT_OF_MEMORY: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_CONTINUE: + case GNUNET_MHD_PR_CONTINUE: return MHD_YES; - case GNUNET_JSON_PR_REQUEST_TOO_LARGE: + case GNUNET_MHD_PR_REQUEST_TOO_LARGE: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_JSON_INVALID: + case GNUNET_MHD_PR_JSON_INVALID: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_SUCCESS: + case GNUNET_MHD_PR_SUCCESS: break; } diff --git a/src/bank-lib/fakebank_bank_post_withdrawals_id_op.c b/src/bank-lib/fakebank_bank_post_withdrawals_id_op.c @@ -27,6 +27,7 @@ #include "taler_bank_service.h" #include "taler_mhd_lib.h" #include <gnunet/gnunet_mhd_compat.h> +#include <gnunet/gnunet_mhd_lib.h> #include "fakebank.h" #include "fakebank_bank_post_withdrawals_id_op.h" #include "fakebank_common_lookup.h" @@ -276,33 +277,33 @@ TALER_FAKEBANK_bank_withdrawals_id_op_ ( if (NULL == cc) { cc = GNUNET_new (struct ConnectionContext); - cc->ctx_cleaner = &GNUNET_JSON_post_parser_cleanup; + cc->ctx_cleaner = &GNUNET_MHD_post_parser_cleanup; *con_cls = cc; } if (0 != *upload_data_size) { - enum GNUNET_JSON_PostResult pr; + enum GNUNET_MHD_PostResult pr; - pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX, - connection, - &cc->ctx, - upload_data, - upload_data_size, - &json); + pr = GNUNET_MHD_post_parser (REQUEST_BUFFER_MAX, + connection, + &cc->ctx, + upload_data, + upload_data_size, + &json); switch (pr) { - case GNUNET_JSON_PR_OUT_OF_MEMORY: + case GNUNET_MHD_PR_OUT_OF_MEMORY: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_CONTINUE: + case GNUNET_MHD_PR_CONTINUE: return MHD_YES; - case GNUNET_JSON_PR_REQUEST_TOO_LARGE: + case GNUNET_MHD_PR_REQUEST_TOO_LARGE: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_JSON_INVALID: + case GNUNET_MHD_PR_JSON_INVALID: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_SUCCESS: + case GNUNET_MHD_PR_SUCCESS: break; } } diff --git a/src/bank-lib/fakebank_bank_testing_register.c b/src/bank-lib/fakebank_bank_testing_register.c @@ -26,6 +26,7 @@ #include "taler_bank_service.h" #include "taler_mhd_lib.h" #include <gnunet/gnunet_mhd_compat.h> +#include <gnunet/gnunet_mhd_lib.h> #include "fakebank.h" #include "fakebank_bank_testing_register.h" @@ -39,36 +40,36 @@ TALER_FAKEBANK_bank_testing_register_ ( void **con_cls) { struct ConnectionContext *cc = *con_cls; - enum GNUNET_JSON_PostResult pr; + enum GNUNET_MHD_PostResult pr; json_t *json; MHD_RESULT res; if (NULL == cc) { cc = GNUNET_new (struct ConnectionContext); - cc->ctx_cleaner = &GNUNET_JSON_post_parser_cleanup; + cc->ctx_cleaner = &GNUNET_MHD_post_parser_cleanup; *con_cls = cc; } - pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX, - connection, - &cc->ctx, - upload_data, - upload_data_size, - &json); + pr = GNUNET_MHD_post_parser (REQUEST_BUFFER_MAX, + connection, + &cc->ctx, + upload_data, + upload_data_size, + &json); switch (pr) { - case GNUNET_JSON_PR_OUT_OF_MEMORY: + case GNUNET_MHD_PR_OUT_OF_MEMORY: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_CONTINUE: + case GNUNET_MHD_PR_CONTINUE: return MHD_YES; - case GNUNET_JSON_PR_REQUEST_TOO_LARGE: + case GNUNET_MHD_PR_REQUEST_TOO_LARGE: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_JSON_INVALID: + case GNUNET_MHD_PR_JSON_INVALID: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_SUCCESS: + case GNUNET_MHD_PR_SUCCESS: break; } diff --git a/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c b/src/bank-lib/fakebank_tbi_post_withdrawal_operation.c @@ -27,6 +27,7 @@ #include "taler_bank_service.h" #include "taler_mhd_lib.h" #include <gnunet/gnunet_mhd_compat.h> +#include <gnunet/gnunet_mhd_lib.h> #include "fakebank.h" #include "fakebank_common_lookup.h" #include "fakebank_tbi_post_withdrawal_operation.h" @@ -205,36 +206,36 @@ TALER_FAKEBANK_tbi_post_withdrawal ( void **con_cls) { struct ConnectionContext *cc = *con_cls; - enum GNUNET_JSON_PostResult pr; + enum GNUNET_MHD_PostResult pr; json_t *json; MHD_RESULT res; if (NULL == cc) { cc = GNUNET_new (struct ConnectionContext); - cc->ctx_cleaner = &GNUNET_JSON_post_parser_cleanup; + cc->ctx_cleaner = &GNUNET_MHD_post_parser_cleanup; *con_cls = cc; } - pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX, - connection, - &cc->ctx, - upload_data, - upload_data_size, - &json); + pr = GNUNET_MHD_post_parser (REQUEST_BUFFER_MAX, + connection, + &cc->ctx, + upload_data, + upload_data_size, + &json); switch (pr) { - case GNUNET_JSON_PR_OUT_OF_MEMORY: + case GNUNET_MHD_PR_OUT_OF_MEMORY: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_CONTINUE: + case GNUNET_MHD_PR_CONTINUE: return MHD_YES; - case GNUNET_JSON_PR_REQUEST_TOO_LARGE: + case GNUNET_MHD_PR_REQUEST_TOO_LARGE: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_JSON_INVALID: + case GNUNET_MHD_PR_JSON_INVALID: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_SUCCESS: + case GNUNET_MHD_PR_SUCCESS: break; } diff --git a/src/bank-lib/fakebank_twg_admin_add_incoming.c b/src/bank-lib/fakebank_twg_admin_add_incoming.c @@ -26,6 +26,7 @@ #include "taler_bank_service.h" #include "taler_mhd_lib.h" #include <gnunet/gnunet_mhd_compat.h> +#include <gnunet/gnunet_mhd_lib.h> #include "fakebank.h" #include "fakebank_common_make_admin_transfer.h" #include "fakebank_twg_admin_add_incoming.h" @@ -40,7 +41,7 @@ TALER_FAKEBANK_twg_admin_add_incoming_ ( void **con_cls) { struct ConnectionContext *cc = *con_cls; - enum GNUNET_JSON_PostResult pr; + enum GNUNET_MHD_PostResult pr; json_t *json; uint64_t row_id; struct GNUNET_TIME_Timestamp timestamp; @@ -48,29 +49,29 @@ TALER_FAKEBANK_twg_admin_add_incoming_ ( if (NULL == cc) { cc = GNUNET_new (struct ConnectionContext); - cc->ctx_cleaner = &GNUNET_JSON_post_parser_cleanup; + cc->ctx_cleaner = &GNUNET_MHD_post_parser_cleanup; *con_cls = cc; } - pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX, - connection, - &cc->ctx, - upload_data, - upload_data_size, - &json); + pr = GNUNET_MHD_post_parser (REQUEST_BUFFER_MAX, + connection, + &cc->ctx, + upload_data, + upload_data_size, + &json); switch (pr) { - case GNUNET_JSON_PR_OUT_OF_MEMORY: + case GNUNET_MHD_PR_OUT_OF_MEMORY: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_CONTINUE: + case GNUNET_MHD_PR_CONTINUE: return MHD_YES; - case GNUNET_JSON_PR_REQUEST_TOO_LARGE: + case GNUNET_MHD_PR_REQUEST_TOO_LARGE: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_JSON_INVALID: + case GNUNET_MHD_PR_JSON_INVALID: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_SUCCESS: + case GNUNET_MHD_PR_SUCCESS: break; } { diff --git a/src/bank-lib/fakebank_twg_admin_add_kycauth.c b/src/bank-lib/fakebank_twg_admin_add_kycauth.c @@ -26,6 +26,7 @@ #include "taler_bank_service.h" #include "taler_mhd_lib.h" #include <gnunet/gnunet_mhd_compat.h> +#include <gnunet/gnunet_mhd_lib.h> #include "fakebank.h" #include "fakebank_common_make_admin_transfer.h" #include "fakebank_twg_admin_add_kycauth.h" @@ -41,7 +42,7 @@ TALER_FAKEBANK_twg_admin_add_kycauth_ ( void **con_cls) { struct ConnectionContext *cc = *con_cls; - enum GNUNET_JSON_PostResult pr; + enum GNUNET_MHD_PostResult pr; json_t *json; uint64_t row_id; struct GNUNET_TIME_Timestamp timestamp; @@ -49,29 +50,29 @@ TALER_FAKEBANK_twg_admin_add_kycauth_ ( if (NULL == cc) { cc = GNUNET_new (struct ConnectionContext); - cc->ctx_cleaner = &GNUNET_JSON_post_parser_cleanup; + cc->ctx_cleaner = &GNUNET_MHD_post_parser_cleanup; *con_cls = cc; } - pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX, - connection, - &cc->ctx, - upload_data, - upload_data_size, - &json); + pr = GNUNET_MHD_post_parser (REQUEST_BUFFER_MAX, + connection, + &cc->ctx, + upload_data, + upload_data_size, + &json); switch (pr) { - case GNUNET_JSON_PR_OUT_OF_MEMORY: + case GNUNET_MHD_PR_OUT_OF_MEMORY: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_CONTINUE: + case GNUNET_MHD_PR_CONTINUE: return MHD_YES; - case GNUNET_JSON_PR_REQUEST_TOO_LARGE: + case GNUNET_MHD_PR_REQUEST_TOO_LARGE: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_JSON_INVALID: + case GNUNET_MHD_PR_JSON_INVALID: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_SUCCESS: + case GNUNET_MHD_PR_SUCCESS: break; } { diff --git a/src/bank-lib/fakebank_twg_transfer.c b/src/bank-lib/fakebank_twg_transfer.c @@ -26,6 +26,7 @@ #include "taler_bank_service.h" #include "taler_mhd_lib.h" #include <gnunet/gnunet_mhd_compat.h> +#include <gnunet/gnunet_mhd_lib.h> #include "fakebank.h" #include "fakebank_common_transact.h" #include "fakebank_twg_transfer.h" @@ -52,7 +53,7 @@ TALER_FAKEBANK_handle_transfer_ ( void **con_cls) { struct ConnectionContext *cc = *con_cls; - enum GNUNET_JSON_PostResult pr; + enum GNUNET_MHD_PostResult pr; json_t *json; uint64_t row_id; struct GNUNET_TIME_Timestamp ts; @@ -60,29 +61,29 @@ TALER_FAKEBANK_handle_transfer_ ( if (NULL == cc) { cc = GNUNET_new (struct ConnectionContext); - cc->ctx_cleaner = &GNUNET_JSON_post_parser_cleanup; + cc->ctx_cleaner = &GNUNET_MHD_post_parser_cleanup; *con_cls = cc; } - pr = GNUNET_JSON_post_parser (REQUEST_BUFFER_MAX, - connection, - &cc->ctx, - upload_data, - upload_data_size, - &json); + pr = GNUNET_MHD_post_parser (REQUEST_BUFFER_MAX, + connection, + &cc->ctx, + upload_data, + upload_data_size, + &json); switch (pr) { - case GNUNET_JSON_PR_OUT_OF_MEMORY: + case GNUNET_MHD_PR_OUT_OF_MEMORY: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_CONTINUE: + case GNUNET_MHD_PR_CONTINUE: return MHD_YES; - case GNUNET_JSON_PR_REQUEST_TOO_LARGE: + case GNUNET_MHD_PR_REQUEST_TOO_LARGE: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_JSON_INVALID: + case GNUNET_MHD_PR_JSON_INVALID: GNUNET_break (0); return MHD_NO; - case GNUNET_JSON_PR_SUCCESS: + case GNUNET_MHD_PR_SUCCESS: break; } { diff --git a/src/mhd/Makefile.am b/src/mhd/Makefile.am @@ -24,6 +24,7 @@ libtalermhd_la_LIBADD = \ $(top_builddir)/src/json/libtalerjson.la \ $(top_builddir)/src/util/libtalerutil.la \ -lgnunetjson \ + -lgnunetmhd \ -lgnunetutil \ -lmicrohttpd \ -ljansson \ diff --git a/src/mhd/mhd_parsing.c b/src/mhd/mhd_parsing.c @@ -23,6 +23,7 @@ #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> +#include <gnunet/gnunet_mhd_lib.h> #include "taler_json_lib.h" #include "taler_mhd_lib.h" @@ -34,17 +35,17 @@ TALER_MHD_parse_post_json (struct MHD_Connection *connection, size_t *upload_data_size, json_t **json) { - enum GNUNET_JSON_PostResult pr; - - pr = GNUNET_JSON_post_parser (TALER_MHD_REQUEST_BUFFER_MAX, - connection, - con_cls, - upload_data, - upload_data_size, - json); + enum GNUNET_MHD_PostResult pr; + + pr = GNUNET_MHD_post_parser (TALER_MHD_REQUEST_BUFFER_MAX, + connection, + con_cls, + upload_data, + upload_data_size, + json); switch (pr) { - case GNUNET_JSON_PR_OUT_OF_MEMORY: + case GNUNET_MHD_PR_OUT_OF_MEMORY: GNUNET_break (NULL == *json); return (MHD_NO == TALER_MHD_reply_with_error ( @@ -53,15 +54,15 @@ TALER_MHD_parse_post_json (struct MHD_Connection *connection, TALER_EC_GENERIC_PARSER_OUT_OF_MEMORY, NULL)) ? GNUNET_SYSERR : GNUNET_NO; - case GNUNET_JSON_PR_CONTINUE: + case GNUNET_MHD_PR_CONTINUE: GNUNET_break (NULL == *json); return GNUNET_YES; - case GNUNET_JSON_PR_REQUEST_TOO_LARGE: + case GNUNET_MHD_PR_REQUEST_TOO_LARGE: GNUNET_break (NULL == *json); GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Closing connection, upload too large\n"); return GNUNET_SYSERR; - case GNUNET_JSON_PR_JSON_INVALID: + case GNUNET_MHD_PR_JSON_INVALID: GNUNET_break (NULL == *json); return (MHD_YES == TALER_MHD_reply_with_error (connection, @@ -69,7 +70,7 @@ TALER_MHD_parse_post_json (struct MHD_Connection *connection, TALER_EC_GENERIC_JSON_INVALID, NULL)) ? GNUNET_NO : GNUNET_SYSERR; - case GNUNET_JSON_PR_SUCCESS: + case GNUNET_MHD_PR_SUCCESS: GNUNET_break (NULL != *json); return GNUNET_YES; } @@ -82,7 +83,7 @@ TALER_MHD_parse_post_json (struct MHD_Connection *connection, void TALER_MHD_parse_post_cleanup_callback (void *con_cls) { - GNUNET_JSON_post_parser_cleanup (con_cls); + GNUNET_MHD_post_parser_cleanup (con_cls); }