summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-08-09 21:10:56 +0200
committerChristian Grothoff <christian@grothoff.org>2018-08-09 21:10:56 +0200
commitc51b19512bfc5bf3848211e6a4e9f3534ece7ee2 (patch)
tree46f5506ca113129e5a36897be25ca898a08c6866 /src
parente3f7083b3eb39ed28eee27b6104a3a508437c929 (diff)
downloadexchange-c51b19512bfc5bf3848211e6a4e9f3534ece7ee2.tar.gz
exchange-c51b19512bfc5bf3848211e6a4e9f3534ece7ee2.tar.bz2
exchange-c51b19512bfc5bf3848211e6a4e9f3534ece7ee2.zip
report ore precisely where commands went wrong
Diffstat (limited to 'src')
-rw-r--r--src/benchmark/exchange_benchmark_home/.config/taler/account-2.json4
-rw-r--r--src/benchmark/taler-exchange-benchmark.c34
-rw-r--r--src/exchange-lib/testing_api_cmd_batch.c13
-rw-r--r--src/exchange-lib/testing_api_cmd_deposit.c6
-rw-r--r--src/exchange-lib/testing_api_cmd_payback.c6
-rw-r--r--src/exchange-lib/testing_api_cmd_refresh.c25
-rw-r--r--src/exchange-lib/testing_api_cmd_refund.c6
-rw-r--r--src/exchange-lib/testing_api_cmd_status.c6
-rw-r--r--src/exchange-lib/testing_api_cmd_track.c14
-rw-r--r--src/exchange-lib/testing_api_cmd_withdraw.c10
-rw-r--r--src/exchange/taler-exchange-httpd.c4
11 files changed, 78 insertions, 50 deletions
diff --git a/src/benchmark/exchange_benchmark_home/.config/taler/account-2.json b/src/benchmark/exchange_benchmark_home/.config/taler/account-2.json
index b2160e99c..7061984a0 100644
--- a/src/benchmark/exchange_benchmark_home/.config/taler/account-2.json
+++ b/src/benchmark/exchange_benchmark_home/.config/taler/account-2.json
@@ -1,5 +1,5 @@
{
"url": "payto://x-taler-bank/localhost:8082/2",
- "salt": "S8SBYSZE4CAWMJRWGMS25XYVSVM6KXN4BJYZ34M975MPDDXZ01WAZEMB2139G8VVD8K6FVCR3GSZKNGEQ76XX27HQSM1PPX54SCFYER",
- "master_sig": "J0DHVTAPFB3MY6RRVBX0WGKK7K32XZ7HPKR5JBB6GSQ29AXXFTWM8A1P7STBGKT14YQMYAM4X4EM8GD4FKNDR1MVGK6ANMQYCP9WE0G"
+ "salt": "08QX35Z1DA877F14N865D7GKEQ6B4M1HPQHHHZFAWN6Y64AZ6Y34NJEM6W0H7PES2B3V3QPGGXYDWCJ7181JK55ESB5FTK99Q1PF88G",
+ "master_sig": "KAAGPE2A9GD1N0EFQHRAXNCV0EVENS51SJAX91403F8DTPJZS1BFHA330QEZQP235R1XAND6HT1AVK4FVAC5H2BFSAWCVF0AGTS3T38"
} \ No newline at end of file
diff --git a/src/benchmark/taler-exchange-benchmark.c b/src/benchmark/taler-exchange-benchmark.c
index 342408d88..34777bbe7 100644
--- a/src/benchmark/taler-exchange-benchmark.c
+++ b/src/benchmark/taler-exchange-benchmark.c
@@ -741,21 +741,23 @@ main (int argc,
exchange_url);
GNUNET_free (exchange_url);
duration = GNUNET_TIME_absolute_get_duration (start_time);
-
- fprintf (stdout,
- "Executed (W=%u, D=%u, R~=%5.2f) * P=%u, operations in %s\n",
- howmany_coins,
- howmany_coins,
- (float) howmany_coins * REFRESH_PROBABILITY,
- howmany_clients,
- GNUNET_STRINGS_relative_time_to_string
- (duration,
- GNUNET_NO));
- fprintf (stdout,
- "(approximately %s/coin)\n",
- GNUNET_STRINGS_relative_time_to_string
- (GNUNET_TIME_relative_divide (duration,
- howmany_coins * howmany_clients),
- GNUNET_YES));
+ if (GNUNET_OK == result)
+ {
+ fprintf (stdout,
+ "Executed (W=%u, D=%u, R~=%5.2f) * P=%u, operations in %s\n",
+ howmany_coins,
+ howmany_coins,
+ (float) howmany_coins * REFRESH_PROBABILITY,
+ howmany_clients,
+ GNUNET_STRINGS_relative_time_to_string
+ (duration,
+ GNUNET_NO));
+ fprintf (stdout,
+ "(approximately %s/coin)\n",
+ GNUNET_STRINGS_relative_time_to_string
+ (GNUNET_TIME_relative_divide (duration,
+ howmany_coins * howmany_clients),
+ GNUNET_YES));
+ }
return (GNUNET_OK == result) ? 0 : result;
}
diff --git a/src/exchange-lib/testing_api_cmd_batch.c b/src/exchange-lib/testing_api_cmd_batch.c
index 3912762f1..738012b80 100644
--- a/src/exchange-lib/testing_api_cmd_batch.c
+++ b/src/exchange-lib/testing_api_cmd_batch.c
@@ -33,10 +33,14 @@
*/
struct BatchState
{
- /* CMDs batch. */
+ /**
+ * CMDs batch.
+ */
struct TALER_TESTING_Command *batch;
- /* Internal comand pointer. */
+ /**
+ * Internal comand pointer.
+ */
int batch_ip;
};
@@ -56,7 +60,6 @@ batch_run (void *cls,
struct BatchState *bs = cls;
bs->batch_ip++;
-
TALER_LOG_DEBUG ("Running batched command: %s\n",
bs->batch[bs->batch_ip].label);
@@ -113,8 +116,8 @@ batch_traits (void *cls,
const char *trait,
unsigned int index)
{
- #define CURRENT_CMD_INDEX 0
- #define BATCH_INDEX 1
+#define CURRENT_CMD_INDEX 0
+#define BATCH_INDEX 1
struct BatchState *bs = cls;
diff --git a/src/exchange-lib/testing_api_cmd_deposit.c b/src/exchange-lib/testing_api_cmd_deposit.c
index 4060e660b..c07e8fbb5 100644
--- a/src/exchange-lib/testing_api_cmd_deposit.c
+++ b/src/exchange-lib/testing_api_cmd_deposit.c
@@ -121,9 +121,11 @@ deposit_cb (void *cls,
if (ds->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s\n",
+ "Unexpected response code %u to command %s in %s:%u\n",
http_status,
- ds->is->commands[ds->is->ip].label);
+ ds->is->commands[ds->is->ip].label,
+ __FILE__,
+ __LINE__);
json_dumpf (obj, stderr, 0);
TALER_TESTING_interpreter_fail (ds->is);
return;
diff --git a/src/exchange-lib/testing_api_cmd_payback.c b/src/exchange-lib/testing_api_cmd_payback.c
index 8d0dfb956..56026162a 100644
--- a/src/exchange-lib/testing_api_cmd_payback.c
+++ b/src/exchange-lib/testing_api_cmd_payback.c
@@ -142,9 +142,11 @@ payback_cb (void *cls,
if (ps->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s\n",
+ "Unexpected response code %u to command %s in %s:%u\n",
http_status,
- cmd->label);
+ cmd->label,
+ __FILE__,
+ __LINE__);
json_dumpf (full_response, stderr, 0);
fprintf (stderr, "\n");
TALER_TESTING_interpreter_fail (is);
diff --git a/src/exchange-lib/testing_api_cmd_refresh.c b/src/exchange-lib/testing_api_cmd_refresh.c
index 89c7852c2..a7cd2e65e 100644
--- a/src/exchange-lib/testing_api_cmd_refresh.c
+++ b/src/exchange-lib/testing_api_cmd_refresh.c
@@ -232,9 +232,11 @@ reveal_cb (void *cls,
if (rrs->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s\n",
+ "Unexpected response code %u to command %s in %s:%u\n",
http_status,
- rrs->is->commands[rrs->is->ip].label);
+ rrs->is->commands[rrs->is->ip].label,
+ __FILE__,
+ __LINE__);
json_dumpf (full_response, stderr, 0);
TALER_TESTING_interpreter_fail (rrs->is);
return;
@@ -400,9 +402,11 @@ link_cb (void *cls,
if (rls->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s\n",
+ "Unexpected response code %u to command %s in %s:%u\n",
http_status,
- link_cmd->label);
+ link_cmd->label,
+ __FILE__,
+ __LINE__);
json_dumpf (full_response, stderr, 0);
TALER_TESTING_interpreter_fail (rls->is);
return;
@@ -431,8 +435,11 @@ link_cb (void *cls,
if (num_coins != *num_fresh_coins)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected number of fresh coins: %d vs %d\n",
- num_coins, *num_fresh_coins);
+ "Unexpected number of fresh coins: %d vs %d in %s:%u\n",
+ num_coins,
+ *num_fresh_coins,
+ __FILE__,
+ __LINE__);
TALER_TESTING_interpreter_fail (rls->is);
return;
}
@@ -626,9 +633,11 @@ melt_cb (void *cls,
if (rms->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s\n",
+ "Unexpected response code %u to command %s in %s:%u\n",
http_status,
- rms->is->commands[rms->is->ip].label);
+ rms->is->commands[rms->is->ip].label,
+ __FILE__,
+ __LINE__);
json_dumpf (full_response, stderr, 0);
TALER_TESTING_interpreter_fail (rms->is);
return;
diff --git a/src/exchange-lib/testing_api_cmd_refund.c b/src/exchange-lib/testing_api_cmd_refund.c
index caf5dcfda..c6e3f9580 100644
--- a/src/exchange-lib/testing_api_cmd_refund.c
+++ b/src/exchange-lib/testing_api_cmd_refund.c
@@ -105,9 +105,11 @@ refund_cb (void *cls,
if (rs->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s\n",
+ "Unexpected response code %u to command %s in %s:%u\n",
http_status,
- refund_cmd->label);
+ refund_cmd->label,
+ __FILE__,
+ __LINE__);
json_dumpf (obj, stderr, 0);
TALER_TESTING_interpreter_fail (rs->is);
return;
diff --git a/src/exchange-lib/testing_api_cmd_status.c b/src/exchange-lib/testing_api_cmd_status.c
index 1e5f6710d..41144d3d8 100644
--- a/src/exchange-lib/testing_api_cmd_status.c
+++ b/src/exchange-lib/testing_api_cmd_status.c
@@ -95,8 +95,10 @@ reserve_status_cb
if (ss->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected HTTP response code: %d\n",
- http_status);
+ "Unexpected HTTP response code: %d in %s:%u\n",
+ http_status,
+ __FILE__,
+ __LINE__);
TALER_TESTING_interpreter_fail (ss->is);
return;
}
diff --git a/src/exchange-lib/testing_api_cmd_track.c b/src/exchange-lib/testing_api_cmd_track.c
index 60f412c8b..8ce9b7bc4 100644
--- a/src/exchange-lib/testing_api_cmd_track.c
+++ b/src/exchange-lib/testing_api_cmd_track.c
@@ -184,9 +184,11 @@ deposit_wtid_cb
if (tts->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s\n",
+ "Unexpected response code %u to command %s in %s:%u\n",
http_status,
- cmd->label);
+ cmd->label,
+ __FILE__,
+ __LINE__);
json_dumpf (json, stderr, 0);
TALER_TESTING_interpreter_fail (is);
return;
@@ -224,7 +226,7 @@ deposit_wtid_cb
TALER_TESTING_interpreter_fail (is);
return;
}
-
+
/* Compare that expected and gotten subjects match. */
if (0 != strcmp (ws, transfer_subject))
{
@@ -527,9 +529,11 @@ track_transfer_cb
if (tts->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s\n",
+ "Unexpected response code %u to command %s in %s:%u\n",
http_status,
- cmd->label);
+ cmd->label,
+ __FILE__,
+ __LINE__);
json_dumpf (json, stderr, 0);
TALER_TESTING_interpreter_fail (is);
return;
diff --git a/src/exchange-lib/testing_api_cmd_withdraw.c b/src/exchange-lib/testing_api_cmd_withdraw.c
index 1ee0e3b5e..c36d116e9 100644
--- a/src/exchange-lib/testing_api_cmd_withdraw.c
+++ b/src/exchange-lib/testing_api_cmd_withdraw.c
@@ -120,9 +120,11 @@ reserve_withdraw_cb (void *cls,
if (ws->expected_response_code != http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s\n",
+ "Unexpected response code %u to command %s in %s:%u\n",
http_status,
- TALER_TESTING_interpreter_get_current_label (is));
+ TALER_TESTING_interpreter_get_current_label (is),
+ __FILE__,
+ __LINE__);
json_dumpf (full_response,
stderr,
0);
@@ -269,7 +271,7 @@ withdraw_traits (void *cls,
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ws->is);
- return GNUNET_SYSERR;
+ return GNUNET_SYSERR;
}
if (GNUNET_OK != TALER_TESTING_get_trait_reserve_priv
@@ -277,7 +279,7 @@ withdraw_traits (void *cls,
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ws->is);
- return GNUNET_SYSERR;
+ return GNUNET_SYSERR;
}
struct TALER_TESTING_Trait traits[] = {
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index 71e5c8b53..9c9579e76 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -944,11 +944,11 @@ main (int argc,
}
mhd
- = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_PIPE_FOR_SHUTDOWN | MHD_USE_DEBUG | MHD_USE_DUAL_STACK, // | MHD_USE_INTERNAL_POLLING_THREAD,
+ = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_PIPE_FOR_SHUTDOWN | MHD_USE_DEBUG | MHD_USE_DUAL_STACK | MHD_USE_INTERNAL_POLLING_THREAD,
(-1 == fh) ? serve_port : 0,
NULL, NULL,
&handle_mhd_request, NULL,
- /* MHD_OPTION_THREAD_POOL_SIZE, (unsigned int) 8, */
+ MHD_OPTION_THREAD_POOL_SIZE, (unsigned int) 16,
MHD_OPTION_LISTEN_SOCKET, fh,
MHD_OPTION_EXTERNAL_LOGGER, &handle_mhd_logs, NULL,
MHD_OPTION_NOTIFY_COMPLETED, &handle_mhd_completion_callback, NULL,