diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-03-20 02:36:50 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-03-20 02:36:50 +0100 |
commit | 10c56bcea05df9ac5a7036850039900fbe435e00 (patch) | |
tree | 858b5d691cfecbab0216eaf415ac462e4b07cc37 /src/lib/exchange_api_transfers_get.c | |
parent | 7a1c6769e428f6f8bb413fb74383c82e16871d2c (diff) | |
download | exchange-10c56bcea05df9ac5a7036850039900fbe435e00.tar.xz |
improving benchmarking logic, including more timings
Diffstat (limited to 'src/lib/exchange_api_transfers_get.c')
-rw-r--r-- | src/lib/exchange_api_transfers_get.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/exchange_api_transfers_get.c b/src/lib/exchange_api_transfers_get.c index 6d61e1d04..617c897d3 100644 --- a/src/lib/exchange_api_transfers_get.c +++ b/src/lib/exchange_api_transfers_get.c @@ -261,11 +261,13 @@ handle_transfers_get_finished (void *cls, { struct TALER_EXCHANGE_TransfersGetHandle *wdh = cls; const json_t *j = response; + enum TALER_ErrorCode ec; wdh->job = NULL; switch (response_code) { case 0: + ec = TALER_EC_INVALID_RESPONSE; break; case MHD_HTTP_OK: if (GNUNET_OK == @@ -273,27 +275,33 @@ handle_transfers_get_finished (void *cls, j)) return; GNUNET_break_op (0); + ec = TALER_EC_TRACK_TRANSFER_REPLY_MALFORMED; response_code = 0; break; case MHD_HTTP_BAD_REQUEST: /* This should never happen, either us or the exchange is buggy (or API version conflict); just pass JSON reply to the application */ + ec = TALER_JSON_get_error_code (j); break; case MHD_HTTP_FORBIDDEN: /* Nothing really to verify, exchange says one of the signatures is invalid; as we checked them, this should never happen, we should pass the JSON reply to the application */ + ec = TALER_JSON_get_error_code (j); break; case MHD_HTTP_NOT_FOUND: /* Exchange does not know about transaction; we should pass the reply to the application */ + ec = TALER_JSON_get_error_code (j); break; case MHD_HTTP_INTERNAL_SERVER_ERROR: /* Server had an internal issue; we should retry, but this API leaves this to the application */ + ec = TALER_JSON_get_error_code (j); break; default: /* unexpected response code */ + ec = TALER_JSON_get_error_code (j); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unexpected response code %u\n", (unsigned int) response_code); @@ -303,7 +311,7 @@ handle_transfers_get_finished (void *cls, } wdh->cb (wdh->cb_cls, response_code, - TALER_JSON_get_error_code (j), + ec, NULL, j, NULL, |