diff options
Diffstat (limited to 'src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c')
-rw-r--r-- | src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c | 73 |
1 files changed, 19 insertions, 54 deletions
diff --git a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c index 81ff2e6fb..9319735fd 100644 --- a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c +++ b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,20 +36,20 @@ */ static enum GNUNET_GenericReturnValue process_row_minor_inconsistencies (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_RowMinorInconsistencies - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_RowMinorInconsistencies + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("row_id", serial_id), -GNUNET_JSON_pack_string("row_table", dc->row_table), -GNUNET_JSON_pack_string("diagnostic", dc->diagnostic), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("row_id", serial_id), + GNUNET_JSON_pack_string ("row_table", dc->row_table), + GNUNET_JSON_pack_string ("diagnostic", dc->diagnostic), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -77,12 +73,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_ROW_MINOR_INCONSISTENCIES_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -120,40 +116,12 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_get (struct TAH_RequestHandler *rh, &offset); bool return_suppressed = false; - - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), - GNUNET_JSON_spec_end () - }; - - // read the input json - json_t *json_in; + const char *ret_s = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "return_suppressed"); + if (ret_s != NULL && strcmp (ret_s, "true") == 0) { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json_in); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json_in)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json_in, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json_in); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json_in); - return MHD_YES; /* failure */ - } + return_suppressed = true; } qs = TAH_plugin->get_row_minor_inconsistencies ( @@ -181,6 +149,3 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("row-minor-inconsistencies", ja)); } - - -
\ No newline at end of file |