From 3d27addfb97a6d4f10eedecce8d707c5d18774b7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 13 Apr 2022 09:19:19 +0200 Subject: -more work on #7222 --- src/reducer/anastasis_api_backup_redux.c | 22 ++++++++++------------ src/reducer/anastasis_api_redux.c | 11 +++++------ 2 files changed, 15 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/reducer/anastasis_api_backup_redux.c b/src/reducer/anastasis_api_backup_redux.c index 9a9b3ad..2e73587 100644 --- a/src/reducer/anastasis_api_backup_redux.c +++ b/src/reducer/anastasis_api_backup_redux.c @@ -1168,13 +1168,11 @@ provider_candidate (struct PolicyBuilder *pb, json_object_foreach (pb->providers, url, pconfig) { - bool disabled = false; + const char *status; uint32_t http_status = 0; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_bool ("disabled", - &disabled), - NULL), + GNUNET_JSON_spec_string ("status", + &status), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_uint32 ("http_status", &http_status), @@ -1191,7 +1189,8 @@ provider_candidate (struct PolicyBuilder *pb, continue; } if ( (MHD_HTTP_OK != http_status) || - disabled) + (0 == strcmp (status, + "disabled")) ) { GNUNET_JSON_parse_free (spec); continue; @@ -2560,13 +2559,11 @@ update_expiration_cost (json_t *state, off++; { struct TALER_Amount upload_cost; - bool disabled = false; + const char *status; uint32_t http_status = 0; struct GNUNET_JSON_Specification pspec[] = { - GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_bool ("disabled", - &disabled), - NULL), + GNUNET_JSON_spec_string ("status", + &status), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_uint32 ("http_status", &http_status), @@ -2589,7 +2586,8 @@ update_expiration_cost (json_t *state, return GNUNET_SYSERR; } if ( (MHD_HTTP_OK != http_status) || - disabled) + (0 != strcmp (status, + "ok")) ) { GNUNET_break (0); return GNUNET_SYSERR; diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c index b66eec3..b9d18ab 100644 --- a/src/reducer/anastasis_api_redux.c +++ b/src/reducer/anastasis_api_redux.c @@ -2034,13 +2034,11 @@ ANASTASIS_reducer_lookup_salt ( const json_t *aps; const json_t *cfg; uint32_t http_status = 0; - bool disabled = false; + const char *status; bool no_salt; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_bool ("disabled", - &disabled), - NULL), + GNUNET_JSON_spec_string ("status", + &status), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_uint32 ("http_status", &http_status), @@ -2075,7 +2073,8 @@ ANASTASIS_reducer_lookup_salt ( GNUNET_break_op (0); return GNUNET_NO; } - if (disabled) + if (0 == strcmp (status, + "disabled")) return GNUNET_NO; if (no_salt) return GNUNET_NO; -- cgit v1.2.3