diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-04-13 22:04:37 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-04-13 22:04:37 +0200 |
commit | e3e3b0637264b6cbccf9c69b4546429187faa8e7 (patch) | |
tree | d588fe4ba00b39efd35ad435b64ca002369c90b4 /src/authorization/anastasis_authorization_plugin_iban.c | |
parent | 1398cca51c44709cd990fc7ed7b854b802004a97 (diff) | |
download | anastasis-e3e3b0637264b6cbccf9c69b4546429187faa8e7.tar.gz anastasis-e3e3b0637264b6cbccf9c69b4546429187faa8e7.tar.bz2 anastasis-e3e3b0637264b6cbccf9c69b4546429187faa8e7.zip |
-get IBAN test to pass again
Diffstat (limited to 'src/authorization/anastasis_authorization_plugin_iban.c')
-rw-r--r-- | src/authorization/anastasis_authorization_plugin_iban.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_iban.c b/src/authorization/anastasis_authorization_plugin_iban.c index b48aa56..92b4565 100644 --- a/src/authorization/anastasis_authorization_plugin_iban.c +++ b/src/authorization/anastasis_authorization_plugin_iban.c @@ -293,6 +293,8 @@ bank_event_cb (void *cls, } GNUNET_free (amount_s); } + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "IBAN event triggers resumption of request handling\n"); MHD_resume_connection (as->connection); as->trigger (as->trigger_cls); } @@ -370,6 +372,8 @@ test_wire_transfers (struct ANASTASIS_AUTHORIZATION_State *as) struct GNUNET_TIME_Timestamp limit; now = GNUNET_TIME_absolute_get (); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Testing for wire transfers\n"); limit = GNUNET_TIME_absolute_to_timestamp ( GNUNET_TIME_absolute_subtract (now, CODE_VALIDITY_PERIOD)); @@ -395,8 +399,6 @@ test_wire_transfers (struct ANASTASIS_AUTHORIZATION_State *as) case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: break; } - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Marking IBAN challenge as satisfied!\n"); qs = db->mark_challenge_code_satisfied ( db->cls, &as->truth_uuid, @@ -523,7 +525,6 @@ iban_solve (struct ANASTASIS_AUTHORIZATION_State *as, struct ANASTASIS_DatabasePlugin *db = ctx->ac->db; MHD_RESULT mres; enum GNUNET_DB_QueryStatus qs; - struct MHD_Response *resp; struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); struct GNUNET_TIME_Timestamp after; @@ -535,10 +536,6 @@ iban_solve (struct ANASTASIS_AUTHORIZATION_State *as, .code = GNUNET_htonll (as->code) }; - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Subscribing to events for code %llu from %s\n", - (unsigned long long) as->code, - as->iban_number); GNUNET_CRYPTO_hash (as->iban_number, strlen (as->iban_number), &espec.debit_iban_hash); @@ -560,12 +557,10 @@ iban_solve (struct ANASTASIS_AUTHORIZATION_State *as, { case GNUNET_DB_STATUS_HARD_ERROR: case GNUNET_DB_STATUS_SOFT_ERROR: - resp = TALER_MHD_make_error (TALER_EC_ANASTASIS_TRUTH_AUTH_TIMEOUT, - "IBAN payment not yet received"); - mres = MHD_queue_response (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - resp); - MHD_destroy_response (resp); + mres = TALER_MHD_reply_with_error (connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_GENERIC_DB_FETCH_FAILED, + "test challenge code satisfied"); if (MHD_YES != mres) return ANASTASIS_AUTHORIZATION_SRES_FAILED_REPLY_FAILED; return ANASTASIS_AUTHORIZATION_SRES_FAILED; @@ -585,17 +580,20 @@ iban_solve (struct ANASTASIS_AUTHORIZATION_State *as, } if (GNUNET_TIME_absolute_is_future (timeout)) { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Suspending IBAN check until %s\n", + GNUNET_TIME_absolute2s (timeout)); as->connection = connection; MHD_suspend_connection (connection); return ANASTASIS_AUTHORIZATION_SRES_SUSPENDED; } - - resp = TALER_MHD_make_error (TALER_EC_GENERIC_DB_FETCH_FAILED, - NULL); - mres = MHD_queue_response (connection, - MHD_HTTP_FORBIDDEN, - resp); - MHD_destroy_response (resp); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Timeout reached at %s, failing request\n", + GNUNET_TIME_absolute2s (timeout)); + mres = TALER_MHD_reply_with_error (connection, + MHD_HTTP_FORBIDDEN, + TALER_EC_ANASTASIS_IBAN_MISSING_TRANSFER, + NULL); if (MHD_YES != mres) return ANASTASIS_AUTHORIZATION_SRES_FAILED_REPLY_FAILED; return ANASTASIS_AUTHORIZATION_SRES_FAILED; |