diff options
Diffstat (limited to 'src/restclient/anastasis_api_config.c')
-rw-r--r-- | src/restclient/anastasis_api_config.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/restclient/anastasis_api_config.c b/src/restclient/anastasis_api_config.c index 5dcc7ec..215d224 100644 --- a/src/restclient/anastasis_api_config.c +++ b/src/restclient/anastasis_api_config.c @@ -100,7 +100,7 @@ handle_config_finished (void *cls, { const char *name; struct ANASTASIS_Config acfg; - json_t *methods; + const json_t *methods; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("name", &name), @@ -108,8 +108,8 @@ handle_config_finished (void *cls, &acfg.business_name), GNUNET_JSON_spec_string ("version", &acfg.version), - GNUNET_JSON_spec_json ("methods", - &methods), + GNUNET_JSON_spec_array_const ("methods", + &methods), GNUNET_JSON_spec_uint32 ("storage_limit_in_megabytes", &acfg.storage_limit_in_megabytes), TALER_JSON_spec_amount_any ("annual_fee", @@ -157,7 +157,6 @@ handle_config_finished (void *cls, { GNUNET_break_op (0); response_code = 0; - GNUNET_JSON_parse_free (spec); break; } if ( (ANASTASIS_PROTOCOL_CURRENT < current) && @@ -166,7 +165,6 @@ handle_config_finished (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Provider protocol version too new\n"); response_code = 0; - GNUNET_JSON_parse_free (spec); break; } if ( (ANASTASIS_PROTOCOL_CURRENT > current) && @@ -176,17 +174,9 @@ handle_config_finished (void *cls, "Provider protocol version too old\n"); GNUNET_break_op (0); response_code = 0; - GNUNET_JSON_parse_free (spec); break; } } - if (! json_is_array (methods)) - { - GNUNET_break_op (0); - GNUNET_JSON_parse_free (spec); - response_code = 0; - break; - } acfg.methods_length = json_array_size (methods); { struct ANASTASIS_AuthorizationMethodConfig mcfg[GNUNET_NZL ( @@ -210,7 +200,6 @@ handle_config_finished (void *cls, NULL, NULL)) ) { GNUNET_break_op (0); - GNUNET_JSON_parse_free (spec); response_code = 0; goto end; } @@ -222,7 +211,6 @@ handle_config_finished (void *cls, co->cb (co->cb_cls, MHD_HTTP_OK, &acfg); - GNUNET_JSON_parse_free (spec); ANASTASIS_config_cancel (co); return; } |