summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-04-13 09:19:19 +0200
committerChristian Grothoff <christian@grothoff.org>2022-04-13 09:19:19 +0200
commit3d27addfb97a6d4f10eedecce8d707c5d18774b7 (patch)
treeba96424971b471c6d96912a784fc4f2e3f3d61ee /src
parentf96c892972444d7f73231c04a7f40375bd4ff811 (diff)
downloadanastasis-3d27addfb97a6d4f10eedecce8d707c5d18774b7.tar.gz
anastasis-3d27addfb97a6d4f10eedecce8d707c5d18774b7.tar.bz2
anastasis-3d27addfb97a6d4f10eedecce8d707c5d18774b7.zip
-more work on #7222
Diffstat (limited to 'src')
-rw-r--r--src/reducer/anastasis_api_backup_redux.c22
-rw-r--r--src/reducer/anastasis_api_redux.c11
2 files changed, 15 insertions, 18 deletions
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;