summaryrefslogtreecommitdiff
path: root/src/reducer/anastasis_api_backup_redux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reducer/anastasis_api_backup_redux.c')
-rw-r--r--src/reducer/anastasis_api_backup_redux.c48
1 files changed, 37 insertions, 11 deletions
diff --git a/src/reducer/anastasis_api_backup_redux.c b/src/reducer/anastasis_api_backup_redux.c
index d2e5a46..de6537e 100644
--- a/src/reducer/anastasis_api_backup_redux.c
+++ b/src/reducer/anastasis_api_backup_redux.c
@@ -278,6 +278,10 @@ add_authentication (json_t *state,
GNUNET_JSON_spec_end ()
};
+ if (MHD_HTTP_OK !=
+ json_integer_value (json_object_get (details,
+ "http_status")))
+ continue; /* skip providers that are down */
if (GNUNET_OK !=
GNUNET_JSON_parse (details,
ispec,
@@ -856,6 +860,13 @@ eval_provider_selection (struct PolicyBuilder *pb,
return;
}
+ if (MHD_HTTP_OK !=
+ json_integer_value (json_object_get (provider_cfg,
+ "http_status")))
+ {
+ GNUNET_JSON_parse_free (mspec);
+ return; /* skip providers that are down */
+ }
if (GNUNET_OK !=
GNUNET_JSON_parse (provider_cfg,
pspec,
@@ -1144,13 +1155,18 @@ lookup_salt (const json_t *state,
GNUNET_break (0);
return GNUNET_SYSERR;
}
+ if (MHD_HTTP_OK !=
+ json_integer_value (json_object_get (cfg,
+ "http_status")))
+ return GNUNET_NO; /* skip providers that are down */
if (GNUNET_OK !=
GNUNET_JSON_parse (cfg,
spec,
NULL, NULL))
{
- GNUNET_break (0);
- return GNUNET_SYSERR;
+ /* provider not working */
+ GNUNET_break_op (0);
+ return GNUNET_NO;
}
return GNUNET_OK;
}
@@ -1608,6 +1624,7 @@ done_authentication (json_t *state,
json_t *details;
policy_providers = json_array ();
+ GNUNET_assert (NULL != policy_providers);
json_object_foreach (available, url, details)
{
json_t *provider;
@@ -1853,19 +1870,18 @@ add_policy (json_t *state,
"provider URL unknown");
return NULL;
}
+ if (MHD_HTTP_OK !=
+ json_integer_value (json_object_get (prov_cfg,
+ "http_status")))
+ continue;
if (GNUNET_OK !=
GNUNET_JSON_parse (prov_cfg,
spec,
NULL, NULL))
{
- GNUNET_break (0);
+ /* skip provider, likely was down */
json_decref (methods);
- ANASTASIS_redux_fail_ (cb,
- cb_cls,
- TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
- "provider lacks authentication methods");
- return NULL;
-
+ continue;
}
if (! json_is_array (prov_methods))
{
@@ -2310,13 +2326,18 @@ update_expiration_cost (json_t *state,
};
struct TALER_Amount fee;
+ if (MHD_HTTP_OK !=
+ json_integer_value (json_object_get (provider,
+ "http_status")))
+ continue; /* skip providers that are down */
if (GNUNET_OK !=
GNUNET_JSON_parse (provider,
pspec,
NULL, NULL))
{
- GNUNET_break (0);
- return GNUNET_SYSERR;
+ /* strange, skip as well */
+ GNUNET_break_op (0);
+ continue;
}
if (0 >
TALER_amount_multiply (&fee,
@@ -4043,12 +4064,17 @@ check_upload_size_limit (json_t *state,
GNUNET_JSON_spec_end ()
};
+ if (MHD_HTTP_OK !=
+ json_integer_value (json_object_get (ap,
+ "http_status")))
+ continue; /* skip providers that are down */
if (GNUNET_OK !=
GNUNET_JSON_parse (ap,
spec,
NULL, NULL))
{
/* skip malformed provider, likely /config failed */
+ GNUNET_break_op (0);
continue;
}
if (0 == limit)