diff options
Diffstat (limited to 'src/auditor/taler-auditor-httpd_bad-sig-losses-get.c')
-rw-r--r-- | src/auditor/taler-auditor-httpd_bad-sig-losses-get.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/auditor/taler-auditor-httpd_bad-sig-losses-get.c b/src/auditor/taler-auditor-httpd_bad-sig-losses-get.c index bc0a9d47d..300a3b61a 100644 --- a/src/auditor/taler-auditor-httpd_bad-sig-losses-get.c +++ b/src/auditor/taler-auditor-httpd_bad-sig-losses-get.c @@ -46,8 +46,7 @@ add_bad_sig_losses (void *cls, obj = GNUNET_JSON_PACK ( - // TODO: fill in - + GNUNET_JSON_pack_uint64 ("row_id", serial_id), GNUNET_JSON_pack_string ("operation", dc->operation), TALER_JSON_pack_amount ("loss", &dc->loss), GNUNET_JSON_pack_data_auto ("operation_specific_pub", @@ -99,20 +98,29 @@ TAH_BAD_SIG_LOSSES_handler_get (struct TAH_RequestHandler *rh, ja = json_array (); GNUNET_break (NULL != ja); - uint64_t row_id = 0; - bool return_suppressed; + int64_t limit = -20; + uint64_t offset; - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_uint64 ("row_id", - &row_id), + TALER_MHD_parse_request_snumber (connection, + "limit", + &limit); + + if (limit < 0) + offset = INT64_MAX; + else + offset = 0; - GNUNET_JSON_spec_bool ("return_suppressed", - &return_suppressed), + TALER_MHD_parse_request_number (connection, + "offset", + &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; { @@ -145,7 +153,8 @@ TAH_BAD_SIG_LOSSES_handler_get (struct TAH_RequestHandler *rh, qs = TAH_plugin->get_bad_sig_losses ( TAH_plugin->cls, - row_id, + limit, + offset, return_suppressed, &add_bad_sig_losses, ja); |