summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-04 21:34:53 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-04 21:34:53 +0100
commit8338d4574fd60134180ad248350125ec69b63b90 (patch)
tree9f1604e219c1cffb1c7cfeef3659e64c1bd91b67 /src
parentefc07a55918b5393c60c5850ffa0d1a01db92165 (diff)
downloadexchange-8338d4574fd60134180ad248350125ec69b63b90.tar.gz
exchange-8338d4574fd60134180ad248350125ec69b63b90.tar.bz2
exchange-8338d4574fd60134180ad248350125ec69b63b90.zip
improve/test taler-exchange-offline
Diffstat (limited to 'src')
-rw-r--r--src/exchange-tools/taler-exchange-offline.c22
-rw-r--r--src/lib/exchange_api_management_revoke_denomination_key.c5
-rw-r--r--src/lib/exchange_api_management_revoke_signing_key.c5
-rw-r--r--src/lib/exchange_api_management_wire_disable.c5
-rw-r--r--src/lib/exchange_api_management_wire_enable.c5
5 files changed, 34 insertions, 8 deletions
diff --git a/src/exchange-tools/taler-exchange-offline.c b/src/exchange-tools/taler-exchange-offline.c
index de97565e..62b48630 100644
--- a/src/exchange-tools/taler-exchange-offline.c
+++ b/src/exchange-tools/taler-exchange-offline.c
@@ -524,9 +524,10 @@ denom_revocation_cb (
if (MHD_HTTP_NO_CONTENT != hr->http_status)
{
fprintf (stderr,
- "Upload failed for command %u with status %u (%s)\n",
+ "Upload failed for command %u with status %u: %s (%s)\n",
(unsigned int) drr->idx,
hr->http_status,
+ TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
}
GNUNET_CONTAINER_DLL_remove (drr_head,
@@ -606,9 +607,10 @@ signkey_revocation_cb (
if (MHD_HTTP_NO_CONTENT != hr->http_status)
{
fprintf (stderr,
- "Upload failed for command %u with status %u (%s)\n",
+ "Upload failed for command %u with status %u: %s (%s)\n",
(unsigned int) srr->idx,
hr->http_status,
+ TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
}
GNUNET_CONTAINER_DLL_remove (srr_head,
@@ -688,9 +690,10 @@ wire_add_cb (
if (MHD_HTTP_NO_CONTENT != hr->http_status)
{
fprintf (stderr,
- "Upload failed for command %u with status %u (%s)\n",
+ "Upload failed for command %u with status %u: %s (%s)\n",
(unsigned int) war->idx,
hr->http_status,
+ TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
}
GNUNET_CONTAINER_DLL_remove (war_head,
@@ -778,9 +781,10 @@ wire_del_cb (
if (MHD_HTTP_NO_CONTENT != hr->http_status)
{
fprintf (stderr,
- "Upload failed for command %u with status %u (%s)\n",
+ "Upload failed for command %u with status %u: %s (%s)\n",
(unsigned int) wdr->idx,
hr->http_status,
+ TALER_ErrorCode_get_hint (hr->ec),
hr->hint);
}
GNUNET_CONTAINER_DLL_remove (wdr_head,
@@ -826,7 +830,7 @@ upload_wire_del (const char *exchange_url,
&err_line))
{
fprintf (stderr,
- "Invalid input for deling wire account: %s#%u at %u (skipping)\n",
+ "Invalid input to disable wire account: %s#%u at %u (skipping)\n",
err_name,
err_line,
(unsigned int) idx);
@@ -983,6 +987,8 @@ do_upload (char *const *args)
return;
}
trigger_upload (exchange_url);
+ json_decref (out);
+ out = NULL;
GNUNET_free (exchange_url);
}
@@ -1185,7 +1191,7 @@ do_del_wire (char *const *args)
args[0],
"validity_end",
GNUNET_JSON_from_time_abs (now),
- "master_sig_add",
+ "master_sig",
GNUNET_JSON_from_data_auto (&master_sig)));
next (args + 1);
}
@@ -1337,11 +1343,11 @@ work (void *cls)
global_ret = 3;
}
fprintf (stderr,
- "Supported subcommands:");
+ "Supported subcommands:\n");
for (unsigned int i = 0; NULL != cmds[i].name; i++)
{
fprintf (stderr,
- "%s - %s\n",
+ "\t%s - %s\n",
cmds[i].name,
cmds[i].help);
}
diff --git a/src/lib/exchange_api_management_revoke_denomination_key.c b/src/lib/exchange_api_management_revoke_denomination_key.c
index fa296203..722c13ab 100644
--- a/src/lib/exchange_api_management_revoke_denomination_key.c
+++ b/src/lib/exchange_api_management_revoke_denomination_key.c
@@ -89,6 +89,11 @@ handle_revoke_denomination_finished (void *cls,
rh->job = NULL;
switch (response_code)
{
+ case 0:
+ /* no reply */
+ hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
+ hr.hint = "server offline?";
+ break;
case MHD_HTTP_NO_CONTENT:
break;
case MHD_HTTP_FORBIDDEN:
diff --git a/src/lib/exchange_api_management_revoke_signing_key.c b/src/lib/exchange_api_management_revoke_signing_key.c
index 3e8b7f63..c58f7bdb 100644
--- a/src/lib/exchange_api_management_revoke_signing_key.c
+++ b/src/lib/exchange_api_management_revoke_signing_key.c
@@ -86,6 +86,11 @@ handle_revoke_signing_finished (void *cls,
rh->job = NULL;
switch (response_code)
{
+ case 0:
+ /* no reply */
+ hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
+ hr.hint = "server offline?";
+ break;
case MHD_HTTP_NO_CONTENT:
break;
case MHD_HTTP_FORBIDDEN:
diff --git a/src/lib/exchange_api_management_wire_disable.c b/src/lib/exchange_api_management_wire_disable.c
index 157d146b..f7fc719d 100644
--- a/src/lib/exchange_api_management_wire_disable.c
+++ b/src/lib/exchange_api_management_wire_disable.c
@@ -86,6 +86,11 @@ handle_auditor_disable_finished (void *cls,
wh->job = NULL;
switch (response_code)
{
+ case 0:
+ /* no reply */
+ hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
+ hr.hint = "server offline?";
+ break;
case MHD_HTTP_NO_CONTENT:
break;
case MHD_HTTP_FORBIDDEN:
diff --git a/src/lib/exchange_api_management_wire_enable.c b/src/lib/exchange_api_management_wire_enable.c
index 9be4dfb1..6755c169 100644
--- a/src/lib/exchange_api_management_wire_enable.c
+++ b/src/lib/exchange_api_management_wire_enable.c
@@ -86,6 +86,11 @@ handle_auditor_enable_finished (void *cls,
wh->job = NULL;
switch (response_code)
{
+ case 0:
+ /* no reply */
+ hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE;
+ hr.hint = "server offline?";
+ break;
case MHD_HTTP_NO_CONTENT:
break;
case MHD_HTTP_FORBIDDEN: