avoid overloading of global variable
This commit is contained in:
parent
8463572bea
commit
8952a87b85
@ -1 +1 @@
|
|||||||
Subproject commit bf43b20a0362ac19bcf1bab9c33215e55d8d9f36
|
Subproject commit 7adfb722ac988170a31cdfd8132073eb7f2a6c43
|
@ -495,12 +495,12 @@ transaction_completed (void)
|
|||||||
* We got incoming transaction details from the bank. Add them
|
* We got incoming transaction details from the bank. Add them
|
||||||
* to the database.
|
* to the database.
|
||||||
*
|
*
|
||||||
* @param batch_size desired batch size
|
* @param wrap_size desired bulk insert size
|
||||||
* @param details array of transaction details
|
* @param details array of transaction details
|
||||||
* @param details_length length of the @a details array
|
* @param details_length length of the @a details array
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
process_reply (unsigned int batch_size,
|
process_reply (unsigned int wrap_size,
|
||||||
const struct TALER_BANK_CreditDetails *details,
|
const struct TALER_BANK_CreditDetails *details,
|
||||||
unsigned int details_length)
|
unsigned int details_length)
|
||||||
{
|
{
|
||||||
@ -570,7 +570,7 @@ process_reply (unsigned int batch_size,
|
|||||||
qs = db_plugin->reserves_in_insert (db_plugin->cls,
|
qs = db_plugin->reserves_in_insert (db_plugin->cls,
|
||||||
reserves,
|
reserves,
|
||||||
details_length,
|
details_length,
|
||||||
batch_size,
|
wrap_size,
|
||||||
qss);
|
qss);
|
||||||
switch (qs)
|
switch (qs)
|
||||||
{
|
{
|
||||||
@ -581,7 +581,7 @@ process_reply (unsigned int batch_size,
|
|||||||
case GNUNET_DB_STATUS_SOFT_ERROR:
|
case GNUNET_DB_STATUS_SOFT_ERROR:
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||||
"Got DB soft error for batch2_reserves_in_insert (%u). Rolling back.\n",
|
"Got DB soft error for batch2_reserves_in_insert (%u). Rolling back.\n",
|
||||||
batch_size);
|
wrap_size);
|
||||||
handle_soft_error ();
|
handle_soft_error ();
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
@ -686,25 +686,25 @@ static void
|
|||||||
history_cb (void *cls,
|
history_cb (void *cls,
|
||||||
const struct TALER_BANK_CreditHistoryResponse *reply)
|
const struct TALER_BANK_CreditHistoryResponse *reply)
|
||||||
{
|
{
|
||||||
static int batch_mode = -2;
|
static int wrap_size = -2;
|
||||||
|
|
||||||
(void) cls;
|
(void) cls;
|
||||||
if (-2 == batch_mode)
|
if (-2 == wrap_size)
|
||||||
{
|
{
|
||||||
const char *mode = getenv ("TALER_WIREWATCH_BATCH_SIZE");
|
const char *mode = getenv ("TALER_WIREWATCH_WARP_SIZE");
|
||||||
char dummy;
|
char dummy;
|
||||||
|
|
||||||
if ( (NULL == mode) ||
|
if ( (NULL == mode) ||
|
||||||
(1 != sscanf (mode,
|
(1 != sscanf (mode,
|
||||||
"%d%c",
|
"%d%c",
|
||||||
&batch_mode,
|
&wrap_size,
|
||||||
&dummy)) )
|
&dummy)) )
|
||||||
{
|
{
|
||||||
if (NULL != mode)
|
if (NULL != mode)
|
||||||
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
|
||||||
"Bad batch mode `%s' specified\n",
|
"Bad batch mode `%s' specified\n",
|
||||||
mode);
|
mode);
|
||||||
batch_mode = 8; /* maximum supported is currently 8 */
|
wrap_size = 8; /* maximum supported is currently 8 */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GNUNET_assert (NULL == task);
|
GNUNET_assert (NULL == task);
|
||||||
@ -715,7 +715,7 @@ history_cb (void *cls,
|
|||||||
switch (reply->http_status)
|
switch (reply->http_status)
|
||||||
{
|
{
|
||||||
case MHD_HTTP_OK:
|
case MHD_HTTP_OK:
|
||||||
process_reply (batch_mode,
|
process_reply (wrap_size,
|
||||||
reply->details.success.details,
|
reply->details.success.details,
|
||||||
reply->details.success.details_length);
|
reply->details.success.details_length);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user