summaryrefslogtreecommitdiff
path: root/src/reducer/anastasis_api_redux.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-07-31 18:32:20 +0200
committerChristian Grothoff <grothoff@gnunet.org>2023-07-31 18:32:20 +0200
commit661bd552f0c2f6ba77860dae633322ddaf19bd6d (patch)
tree2d606f9a8f951dc39284c58e762315d3d2c4b3de /src/reducer/anastasis_api_redux.c
parent1b36d79083247a1750e42e43b485f0581057b3a7 (diff)
downloadanastasis-661bd552f0c2f6ba77860dae633322ddaf19bd6d.tar.gz
anastasis-661bd552f0c2f6ba77860dae633322ddaf19bd6d.tar.bz2
anastasis-661bd552f0c2f6ba77860dae633322ddaf19bd6d.zip
future-proof API
Diffstat (limited to 'src/reducer/anastasis_api_redux.c')
-rw-r--r--src/reducer/anastasis_api_redux.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c
index 31a389b..4b5ad7b 100644
--- a/src/reducer/anastasis_api_redux.c
+++ b/src/reducer/anastasis_api_redux.c
@@ -599,12 +599,10 @@ retry_config (void *cls);
* Function called with the results of a #ANASTASIS_get_config().
*
* @param cls closure
- * @param http_status HTTP status of the request
* @param acfg anastasis configuration
*/
static void
config_cb (void *cls,
- unsigned int http_status,
const struct ANASTASIS_Config *acfg)
{
struct ConfigRequest *cr = cls;
@@ -615,23 +613,23 @@ config_cb (void *cls,
GNUNET_SCHEDULER_cancel (cr->tt);
cr->tt = NULL;
}
- cr->http_status = http_status;
- if (MHD_HTTP_OK != http_status)
+ cr->http_status = acfg->http_status;
+ if (MHD_HTTP_OK != acfg->http_status)
{
- if (0 == http_status)
+ if (0 == acfg->http_status)
cr->ec = TALER_EC_ANASTASIS_GENERIC_PROVIDER_UNREACHABLE;
else
cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED;
}
- if ( (MHD_HTTP_OK == http_status) &&
+ if ( (MHD_HTTP_OK == acfg->http_status) &&
(NULL == acfg) )
{
cr->http_status = MHD_HTTP_NOT_FOUND;
cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED;
}
- else if (NULL != acfg)
+ else
{
- if (0 == acfg->storage_limit_in_megabytes)
+ if (0 == acfg->details.ok.storage_limit_in_megabytes)
{
cr->http_status = 0;
cr->ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_INVALID_CONFIG;
@@ -640,27 +638,28 @@ config_cb (void *cls,
{
cr->ec = TALER_EC_NONE;
GNUNET_free (cr->business_name);
- cr->business_name = GNUNET_strdup (acfg->business_name);
+ cr->business_name = GNUNET_strdup (acfg->details.ok.business_name);
for (unsigned int i = 0; i<cr->methods_length; i++)
GNUNET_free (cr->methods[i].type);
GNUNET_free (cr->methods);
- cr->methods = GNUNET_new_array (acfg->methods_length,
+ cr->methods = GNUNET_new_array (acfg->details.ok.methods_length,
struct AuthorizationMethodConfig);
- for (unsigned int i = 0; i<acfg->methods_length; i++)
+ for (unsigned int i = 0; i<acfg->details.ok.methods_length; i++)
{
- cr->methods[i].type = GNUNET_strdup (acfg->methods[i].type);
- cr->methods[i].usage_fee = acfg->methods[i].usage_fee;
+ cr->methods[i].type = GNUNET_strdup (acfg->details.ok.methods[i].type);
+ cr->methods[i].usage_fee = acfg->details.ok.methods[i].usage_fee;
}
- cr->methods_length = acfg->methods_length;
- cr->storage_limit_in_megabytes = acfg->storage_limit_in_megabytes;
- cr->annual_fee = acfg->annual_fee;
- cr->truth_upload_fee = acfg->truth_upload_fee;
- cr->liability_limit = acfg->liability_limit;
- cr->provider_salt = acfg->provider_salt;
+ cr->methods_length = acfg->details.ok.methods_length;
+ cr->storage_limit_in_megabytes =
+ acfg->details.ok.storage_limit_in_megabytes;
+ cr->annual_fee = acfg->details.ok.annual_fee;
+ cr->truth_upload_fee = acfg->details.ok.truth_upload_fee;
+ cr->liability_limit = acfg->details.ok.liability_limit;
+ cr->provider_salt = acfg->details.ok.provider_salt;
}
}
notify_waiting (cr);
- if (MHD_HTTP_OK != http_status)
+ if (MHD_HTTP_OK != acfg->http_status)
{
cr->backoff = GNUNET_TIME_STD_BACKOFF (cr->backoff);
GNUNET_assert (NULL == cr->tt);