summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-03 21:41:26 +0200
committerChristian Grothoff <christian@grothoff.org>2016-04-03 21:41:26 +0200
commit9909a04d5bdbe7718dadc022ab27af64e7286e29 (patch)
tree007566cb2816e3bea3292235aee3a289d45212b2 /src
parent08e9c295706048bf5aa502e581c5c54bec48ff5f (diff)
downloadexchange-9909a04d5bdbe7718dadc022ab27af64e7286e29.tar.gz
exchange-9909a04d5bdbe7718dadc022ab27af64e7286e29.tar.bz2
exchange-9909a04d5bdbe7718dadc022ab27af64e7286e29.zip
use new PQ_query_param_string function to fix 0-termination bug, also terminate idle aggregator in test mode
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-aggregator.c16
-rw-r--r--src/exchangedb/plugin_exchangedb_postgres.c4
2 files changed, 14 insertions, 6 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index e293a23cd..2d5fd71d8 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -482,10 +482,18 @@ run_aggregation (void *cls,
*global_ret = GNUNET_SYSERR;
return;
}
- /* nothing to do, sleep for a minute and try again */
- task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
- &run_aggregation,
- global_ret);
+ if (GNUNET_YES == test_mode)
+ {
+ /* in test mode, shutdown if we end up being idle */
+ GNUNET_SCHEDULER_shutdown ();
+ }
+ else
+ {
+ /* nothing to do, sleep for a minute and try again */
+ task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
+ &run_aggregation,
+ global_ret);
+ }
return;
}
/* Now try to find other deposits to aggregate */
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c
index bcd6b9a0c..b59acaead 100644
--- a/src/exchangedb/plugin_exchangedb_postgres.c
+++ b/src/exchangedb/plugin_exchangedb_postgres.c
@@ -4056,7 +4056,7 @@ postgres_wire_prepare_data_insert (void *cls,
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
- GNUNET_PQ_query_param_fixed_size (type, strlen (type) + 1),
+ GNUNET_PQ_query_param_string (type),
GNUNET_PQ_query_param_fixed_size (buf, buf_size),
GNUNET_PQ_query_param_end
};
@@ -4132,7 +4132,7 @@ postgres_wire_prepare_data_get (void *cls,
{
PGresult *result;
struct GNUNET_PQ_QueryParam params[] = {
- GNUNET_PQ_query_param_fixed_size (type, strlen (type) + 1),
+ GNUNET_PQ_query_param_string (type),
GNUNET_PQ_query_param_end
};