summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_link.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-19 19:17:56 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-19 19:17:56 +0100
commit749d9615d12127a33445ceae21a8fa388d2f64a1 (patch)
treeed93cfb3457ddde0b9ff6c527495bb5ad59f4dba /src/lib/exchange_api_link.c
parent15489275ba72905a6f0d84238480569390475c00 (diff)
downloadexchange-749d9615d12127a33445ceae21a8fa388d2f64a1.tar.gz
exchange-749d9615d12127a33445ceae21a8fa388d2f64a1.tar.bz2
exchange-749d9615d12127a33445ceae21a8fa388d2f64a1.zip
concurrency requires strtok_r
Diffstat (limited to 'src/lib/exchange_api_link.c')
-rw-r--r--src/lib/exchange_api_link.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/exchange_api_link.c b/src/lib/exchange_api_link.c
index aa508ecf..75634049 100644
--- a/src/lib/exchange_api_link.c
+++ b/src/lib/exchange_api_link.c
@@ -350,11 +350,13 @@ handle_link_finished (void *cls,
{
struct TALER_EXCHANGE_LinkHandle *lh = cls;
const json_t *j = response;
+ enum TALER_ErrorCode ec;
lh->job = NULL;
switch (response_code)
{
case 0:
+ ec = TALER_EC_INVALID_RESPONSE;
break;
case MHD_HTTP_OK:
if (GNUNET_OK !=
@@ -366,14 +368,17 @@ handle_link_finished (void *cls,
}
break;
case MHD_HTTP_BAD_REQUEST:
+ ec = TALER_JSON_get_error_code (j);
/* This should never happen, either us or the exchange is buggy
(or API version conflict); just pass JSON reply to the application */
break;
case MHD_HTTP_NOT_FOUND:
+ ec = TALER_JSON_get_error_code (j);
/* Nothing really to verify, exchange says this coin was not melted; we
should pass the JSON reply to the application */
break;
case MHD_HTTP_INTERNAL_SERVER_ERROR:
+ ec = TALER_JSON_get_error_code (j);
/* Server had an internal issue; we should retry, but this API
leaves this to the application */
break;
@@ -384,12 +389,13 @@ handle_link_finished (void *cls,
(unsigned int) response_code);
GNUNET_break (0);
response_code = 0;
+ ec = TALER_JSON_get_error_code (j);
break;
}
if (NULL != lh->link_cb)
lh->link_cb (lh->link_cb_cls,
response_code,
- TALER_JSON_get_error_code (j),
+ ec,
0,
NULL,
NULL,