diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-04-05 17:16:04 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-04-05 17:16:04 +0200 |
commit | 71f889186973ef26e8ae684ec47fd570138bc4e5 (patch) | |
tree | 02898d03575384c26b5399d28d702d97f4683403 /src/backend | |
parent | 452aa5391b75ab6637b62398f9b0627593570d5d (diff) | |
download | anastasis-71f889186973ef26e8ae684ec47fd570138bc4e5.tar.gz anastasis-71f889186973ef26e8ae684ec47fd570138bc4e5.tar.bz2 anastasis-71f889186973ef26e8ae684ec47fd570138bc4e5.zip |
adapt to latest GNUnet API: GNUNET_JSON_spec_mark_optional() changed
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/anastasis-httpd_truth-challenge.c | 15 | ||||
-rw-r--r-- | src/backend/anastasis-httpd_truth-solve.c | 13 | ||||
-rw-r--r-- | src/backend/anastasis-httpd_truth-upload.c | 3 |
3 files changed, 15 insertions, 16 deletions
diff --git a/src/backend/anastasis-httpd_truth-challenge.c b/src/backend/anastasis-httpd_truth-challenge.c index 3a3688e..b03c883 100644 --- a/src/backend/anastasis-httpd_truth-challenge.c +++ b/src/backend/anastasis-httpd_truth-challenge.c @@ -156,9 +156,9 @@ struct ChallengeContext unsigned int response_code; /** - * true if client provided a payment secret / order ID? + * true if client did not provide a payment secret / order ID. */ - bool payment_identifier_provided; + bool no_payment_identifier_provided; /** * True if this entry is in the #gc_head DLL. @@ -921,7 +921,7 @@ run_authorization_process (struct MHD_Connection *connection, gc->as = NULL; return MHD_YES; case ANASTASIS_AUTHORIZATION_CRES_FAILED: - if (gc->payment_identifier_provided) + if (! gc->no_payment_identifier_provided) { begin_refund (gc); } @@ -1042,7 +1042,8 @@ AH_handler_truth_challenge ( &gc->truth_key), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("payment_secret", - &gc->payment_identifier)), + &gc->payment_identifier), + &gc->no_payment_identifier_provided), GNUNET_JSON_spec_end () }; enum GNUNET_GenericReturnValue res; @@ -1060,9 +1061,7 @@ AH_handler_truth_challenge ( GNUNET_break_op (0); return MHD_YES; /* failure */ } - gc->payment_identifier_provided - = ! GNUNET_is_zero (&gc->payment_identifier); - if (gc->payment_identifier_provided) + if (! gc->no_payment_identifier_provided) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Client provided payment identifier `%s'\n", TALER_B2S (&gc->payment_identifier)); @@ -1156,7 +1155,7 @@ AH_handler_truth_challenge ( enum GNUNET_DB_QueryStatus qs; bool paid; - if (! gc->payment_identifier_provided) + if (gc->no_payment_identifier_provided) { GNUNET_free (truth_mime); GNUNET_free (encrypted_truth); diff --git a/src/backend/anastasis-httpd_truth-solve.c b/src/backend/anastasis-httpd_truth-solve.c index 9142ad2..5e72e42 100644 --- a/src/backend/anastasis-httpd_truth-solve.c +++ b/src/backend/anastasis-httpd_truth-solve.c @@ -156,9 +156,9 @@ struct SolveContext unsigned int response_code; /** - * true if client provided a payment secret / order ID? + * true if client did not provide a payment secret / order ID. */ - bool payment_identifier_provided; + bool no_payment_identifier_provided; /** * True if this entry is in the #gc_head DLL. @@ -1158,7 +1158,8 @@ AH_handler_truth_solve ( &gc->challenge_response), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("payment_secret", - &gc->payment_identifier)), + &gc->payment_identifier), + &gc->no_payment_identifier_provided), GNUNET_JSON_spec_end () }; enum GNUNET_GenericReturnValue res; @@ -1176,9 +1177,7 @@ AH_handler_truth_solve ( GNUNET_break_op (0); return MHD_YES; /* failure */ } - gc->payment_identifier_provided - = ! GNUNET_is_zero (&gc->payment_identifier); - if (gc->payment_identifier_provided) + if (! gc->no_payment_identifier_provided) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Client provided payment identifier `%s'\n", TALER_B2S (&gc->payment_identifier)); @@ -1256,7 +1255,7 @@ AH_handler_truth_solve ( enum GNUNET_DB_QueryStatus qs; bool paid; - if (! gc->payment_identifier_provided) + if (gc->no_payment_identifier_provided) { GNUNET_free (truth_mime); GNUNET_free (encrypted_truth); diff --git a/src/backend/anastasis-httpd_truth-upload.c b/src/backend/anastasis-httpd_truth-upload.c index b87ccf0..642f523 100644 --- a/src/backend/anastasis-httpd_truth-upload.c +++ b/src/backend/anastasis-httpd_truth-upload.c @@ -538,7 +538,8 @@ AH_handler_truth_post ( &encrypted_truth_size), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("truth_mime", - &truth_mime)), + &truth_mime), + NULL), GNUNET_JSON_spec_uint32 ("storage_duration_years", &storage_years), GNUNET_JSON_spec_end () |