use new PQ_query_param_string function to fix 0-termination bug, also terminate idle aggregator in test mode

This commit is contained in:
Christian Grothoff 2016-04-03 21:41:26 +02:00
parent 08e9c29570
commit 9909a04d5b
2 changed files with 14 additions and 6 deletions

View File

@ -482,10 +482,18 @@ run_aggregation (void *cls,
*global_ret = GNUNET_SYSERR;
return;
}
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 */

View File

@ -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
};