summaryrefslogtreecommitdiff
path: root/src/lib/auditor_api_exchanges.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-20 02:36:50 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-20 02:36:50 +0100
commit10c56bcea05df9ac5a7036850039900fbe435e00 (patch)
tree858b5d691cfecbab0216eaf415ac462e4b07cc37 /src/lib/auditor_api_exchanges.c
parent7a1c6769e428f6f8bb413fb74383c82e16871d2c (diff)
downloadexchange-10c56bcea05df9ac5a7036850039900fbe435e00.tar.gz
exchange-10c56bcea05df9ac5a7036850039900fbe435e00.tar.bz2
exchange-10c56bcea05df9ac5a7036850039900fbe435e00.zip
improving benchmarking logic, including more timings
Diffstat (limited to 'src/lib/auditor_api_exchanges.c')
-rw-r--r--src/lib/auditor_api_exchanges.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/lib/auditor_api_exchanges.c b/src/lib/auditor_api_exchanges.c
index 329b0106..4e23267f 100644
--- a/src/lib/auditor_api_exchanges.c
+++ b/src/lib/auditor_api_exchanges.c
@@ -89,11 +89,13 @@ handle_exchanges_finished (void *cls,
const json_t *ja;
unsigned int ja_len;
struct TALER_AUDITOR_ListExchangesHandle *leh = cls;
+ enum TALER_ErrorCode ec;
leh->job = NULL;
switch (response_code)
{
case 0:
+ ec = TALER_EC_INVALID_RESPONSE;
break;
case MHD_HTTP_OK:
ja = json_object_get (json,
@@ -102,6 +104,7 @@ handle_exchanges_finished (void *cls,
(! json_is_array (ja)) )
{
GNUNET_break (0);
+ ec = TALER_EC_AUDITOR_EXCHANGES_REPLY_MALFORMED;
response_code = 0;
break;
}
@@ -110,6 +113,7 @@ handle_exchanges_finished (void *cls,
if (ja_len > MAX_EXCHANGES)
{
GNUNET_break (0);
+ ec = TALER_EC_AUDITOR_EXCHANGES_REPLY_MALFORMED;
response_code = 0;
break;
}
@@ -134,6 +138,7 @@ handle_exchanges_finished (void *cls,
{
GNUNET_break_op (0);
ok = GNUNET_NO;
+ ec = TALER_EC_AUDITOR_EXCHANGES_REPLY_MALFORMED;
break;
}
}
@@ -145,26 +150,31 @@ handle_exchanges_finished (void *cls,
ja_len,
ei,
json);
- leh->cb = NULL;
+ TALER_AUDITOR_list_exchanges_cancel (leh);
+ return;
}
- break;
case MHD_HTTP_BAD_REQUEST:
/* This should never happen, either us or the auditor is buggy
(or API version conflict); just pass JSON reply to the application */
+ ec = TALER_JSON_get_error_code (json);
break;
case MHD_HTTP_NOT_FOUND:
/* Nothing really to verify, this should never
happen, we should pass the JSON reply to the application */
+ ec = TALER_JSON_get_error_code (json);
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 (json);
break;
default:
/* unexpected response code */
+ ec = TALER_JSON_get_error_code (json);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u\n",
- (unsigned int) response_code);
+ "Unexpected response code %u/%d\n",
+ (unsigned int) response_code,
+ (int) ec);
GNUNET_break (0);
response_code = 0;
break;