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, | |||
100 | { | 100 | { |
101 | const char *name; | 101 | const char *name; |
102 | struct ANASTASIS_Config acfg; | 102 | struct ANASTASIS_Config acfg; |
103 | json_t *methods; | 103 | const json_t *methods; |
104 | struct GNUNET_JSON_Specification spec[] = { | 104 | struct GNUNET_JSON_Specification spec[] = { |
105 | GNUNET_JSON_spec_string ("name", | 105 | GNUNET_JSON_spec_string ("name", |
106 | &name), | 106 | &name), |
@@ -108,8 +108,8 @@ handle_config_finished (void *cls, | |||
108 | &acfg.business_name), | 108 | &acfg.business_name), |
109 | GNUNET_JSON_spec_string ("version", | 109 | GNUNET_JSON_spec_string ("version", |
110 | &acfg.version), | 110 | &acfg.version), |
111 | GNUNET_JSON_spec_json ("methods", | 111 | GNUNET_JSON_spec_array_const ("methods", |
112 | &methods), | 112 | &methods), |
113 | GNUNET_JSON_spec_uint32 ("storage_limit_in_megabytes", | 113 | GNUNET_JSON_spec_uint32 ("storage_limit_in_megabytes", |
114 | &acfg.storage_limit_in_megabytes), | 114 | &acfg.storage_limit_in_megabytes), |
115 | TALER_JSON_spec_amount_any ("annual_fee", | 115 | TALER_JSON_spec_amount_any ("annual_fee", |
@@ -157,7 +157,6 @@ handle_config_finished (void *cls, | |||
157 | { | 157 | { |
158 | GNUNET_break_op (0); | 158 | GNUNET_break_op (0); |
159 | response_code = 0; | 159 | response_code = 0; |
160 | GNUNET_JSON_parse_free (spec); | ||
161 | break; | 160 | break; |
162 | } | 161 | } |
163 | if ( (ANASTASIS_PROTOCOL_CURRENT < current) && | 162 | if ( (ANASTASIS_PROTOCOL_CURRENT < current) && |
@@ -166,7 +165,6 @@ handle_config_finished (void *cls, | |||
166 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 165 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
167 | "Provider protocol version too new\n"); | 166 | "Provider protocol version too new\n"); |
168 | response_code = 0; | 167 | response_code = 0; |
169 | GNUNET_JSON_parse_free (spec); | ||
170 | break; | 168 | break; |
171 | } | 169 | } |
172 | if ( (ANASTASIS_PROTOCOL_CURRENT > current) && | 170 | if ( (ANASTASIS_PROTOCOL_CURRENT > current) && |
@@ -176,17 +174,9 @@ handle_config_finished (void *cls, | |||
176 | "Provider protocol version too old\n"); | 174 | "Provider protocol version too old\n"); |
177 | GNUNET_break_op (0); | 175 | GNUNET_break_op (0); |
178 | response_code = 0; | 176 | response_code = 0; |
179 | GNUNET_JSON_parse_free (spec); | ||
180 | break; | 177 | break; |
181 | } | 178 | } |
182 | } | 179 | } |
183 | if (! json_is_array (methods)) | ||
184 | { | ||
185 | GNUNET_break_op (0); | ||
186 | GNUNET_JSON_parse_free (spec); | ||
187 | response_code = 0; | ||
188 | break; | ||
189 | } | ||
190 | acfg.methods_length = json_array_size (methods); | 180 | acfg.methods_length = json_array_size (methods); |
191 | { | 181 | { |
192 | struct ANASTASIS_AuthorizationMethodConfig mcfg[GNUNET_NZL ( | 182 | struct ANASTASIS_AuthorizationMethodConfig mcfg[GNUNET_NZL ( |
@@ -210,7 +200,6 @@ handle_config_finished (void *cls, | |||
210 | NULL, NULL)) ) | 200 | NULL, NULL)) ) |
211 | { | 201 | { |
212 | GNUNET_break_op (0); | 202 | GNUNET_break_op (0); |
213 | GNUNET_JSON_parse_free (spec); | ||
214 | response_code = 0; | 203 | response_code = 0; |
215 | goto end; | 204 | goto end; |
216 | } | 205 | } |
@@ -222,7 +211,6 @@ handle_config_finished (void *cls, | |||
222 | co->cb (co->cb_cls, | 211 | co->cb (co->cb_cls, |
223 | MHD_HTTP_OK, | 212 | MHD_HTTP_OK, |
224 | &acfg); | 213 | &acfg); |
225 | GNUNET_JSON_parse_free (spec); | ||
226 | ANASTASIS_config_cancel (co); | 214 | ANASTASIS_config_cancel (co); |
227 | return; | 215 | return; |
228 | } | 216 | } |