diff options
| author | Christian Grothoff <christian@grothoff.org> | 2016-03-19 19:16:35 +0100 |
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2016-03-19 19:16:35 +0100 |
| commit | 737e3f4bf67a2048381785328206c595bffe632a (patch) | |
| tree | b9c0a93fc43d1e6cd5c0dbd14ff53d0ee2d29fee /src/exchange/taler-exchange-httpd_reserve.c | |
| parent | 3d5e096fa24a2d11873d7e09a0b994a00882325d (diff) | |
refactor to eliminate duplicated JSON parsing logic (#4150)
Diffstat (limited to 'src/exchange/taler-exchange-httpd_reserve.c')
| -rw-r--r-- | src/exchange/taler-exchange-httpd_reserve.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/exchange/taler-exchange-httpd_reserve.c b/src/exchange/taler-exchange-httpd_reserve.c index 45f07310..1763280e 100644 --- a/src/exchange/taler-exchange-httpd_reserve.c +++ b/src/exchange/taler-exchange-httpd_reserve.c @@ -101,17 +101,17 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh, struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki; struct TMH_KS_StateHandle *ks; - struct TMH_PARSE_FieldSpecification spec[] = { - TMH_PARSE_member_variable ("coin_ev", + struct GNUNET_JSON_Specification spec[] = { + GNUNET_JSON_spec_varsize ("coin_ev", (void **) &blinded_msg, &blinded_msg_len), - TMH_PARSE_member_fixed ("reserve_pub", + GNUNET_JSON_spec_fixed_auto ("reserve_pub", &wsrd.reserve_pub), - TMH_PARSE_member_fixed ("reserve_sig", + GNUNET_JSON_spec_fixed_auto ("reserve_sig", &signature), - TMH_PARSE_member_denomination_public_key ("denom_pub", + TALER_JSON_spec_denomination_public_key ("denom_pub", &denomination_pub), - TMH_PARSE_MEMBER_END + GNUNET_JSON_spec_end () }; res = TMH_PARSE_post_json (connection, @@ -135,7 +135,7 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh, TMH_KS_DKU_WITHDRAW); if (NULL == dki) { - TMH_PARSE_release_data (spec); + GNUNET_JSON_parse_free (spec); TMH_KS_release (ks); return TMH_RESPONSE_reply_arg_unknown (connection, "denom_pub"); @@ -169,7 +169,7 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh, &wsrd.reserve_pub.eddsa_pub)) { TALER_LOG_WARNING ("Client supplied invalid signature for /reserve/withdraw request\n"); - TMH_PARSE_release_data (spec); + GNUNET_JSON_parse_free (spec); return TMH_RESPONSE_reply_signature_invalid (connection, "reserve_sig"); } @@ -179,7 +179,7 @@ TMH_RESERVE_handler_reserve_withdraw (struct TMH_RequestHandler *rh, blinded_msg, blinded_msg_len, &signature); - TMH_PARSE_release_data (spec); + GNUNET_JSON_parse_free (spec); return res; } |
