fix indent
This commit is contained in:
parent
5b2efa2b06
commit
8f7388042c
@ -417,7 +417,8 @@ handle_mhd_request (void *cls,
|
||||
struct GNUNET_AsyncScopeSave old_scope;
|
||||
const char *correlation_id = NULL;
|
||||
|
||||
if (NULL == ecls) {
|
||||
if (NULL == ecls)
|
||||
{
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Handling new request\n");
|
||||
/* We're in a new async scope! */
|
||||
ecls = *con_cls = GNUNET_new (struct ExchangeHttpRequestClosure);
|
||||
@ -435,9 +436,7 @@ handle_mhd_request (void *cls,
|
||||
}
|
||||
|
||||
inner_cls = &ecls->opaque_post_parsing_context;
|
||||
|
||||
GNUNET_async_scope_enter (&ecls->async_scope_id, &old_scope);
|
||||
|
||||
if (NULL != correlation_id)
|
||||
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
|
||||
"Handling request (%s) for URL '%s', correlation_id=%s\n",
|
||||
@ -462,6 +461,8 @@ handle_mhd_request (void *cls,
|
||||
(0 == strcasecmp (method,
|
||||
rh->method)) ) )
|
||||
{
|
||||
/* FIXME: consider caching 'rh' in '**connection_cls' to
|
||||
avoid repeated lookup! */
|
||||
ret = rh->handler (rh,
|
||||
connection,
|
||||
inner_cls,
|
||||
@ -477,7 +478,6 @@ handle_mhd_request (void *cls,
|
||||
upload_data,
|
||||
upload_data_size);
|
||||
GNUNET_async_scope_restore (&old_scope);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -442,6 +442,7 @@ TALER_EXCHANGE_set_now (struct TALER_EXCHANGE_Handle *exchange,
|
||||
void
|
||||
TALER_EXCHANGE_unset_now (struct TALER_EXCHANGE_Handle *exchange);
|
||||
|
||||
|
||||
/**
|
||||
* Let the user set the last valid denomination time manually.
|
||||
*
|
||||
|
@ -16,14 +16,12 @@
|
||||
License along with TALER; see the file COPYING. If not, see
|
||||
<http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file exchange-lib/test_exchange_api_keys_cherry_picking.c
|
||||
* @brief testcase to test exchange's /keys cherry picking ability
|
||||
* @author Marcello Stanisci
|
||||
* @author Christian Grothoff
|
||||
*/
|
||||
|
||||
#include "platform.h"
|
||||
#include "taler_util.h"
|
||||
#include "taler_signatures.h"
|
||||
@ -95,6 +93,7 @@ static char *exchange_url;
|
||||
*/
|
||||
static char *auditor_url;
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper around the time parser.
|
||||
*
|
||||
@ -118,16 +117,15 @@ TTH_parse_time (const char *str)
|
||||
* run.
|
||||
*
|
||||
* @param cls closure
|
||||
* @param is[in,out] interpreter state
|
||||
*/
|
||||
static void
|
||||
run (void *cls,
|
||||
struct TALER_TESTING_Interpreter *is)
|
||||
{
|
||||
struct TALER_TESTING_Command keys_serialization[] = {
|
||||
|
||||
TALER_TESTING_cmd_serialize_keys
|
||||
("serialize-keys"),
|
||||
|
||||
TALER_TESTING_cmd_connect_with_state
|
||||
("reconnect-with-state",
|
||||
"serialize-keys"),
|
||||
@ -152,13 +150,10 @@ run (void *cls,
|
||||
"x-taler-bank",
|
||||
NULL,
|
||||
MHD_HTTP_OK),
|
||||
|
||||
TALER_TESTING_cmd_end (),
|
||||
|
||||
};
|
||||
|
||||
struct TALER_TESTING_Command ordinary_cherry_pick[] = {
|
||||
|
||||
/**
|
||||
* 1 DK with 80s withdraw duration, lookahead_sign is 60s
|
||||
* => expect 1 DK.
|
||||
@ -176,7 +171,6 @@ run (void *cls,
|
||||
("keyup-1",
|
||||
CONFIG_FILE,
|
||||
TTH_parse_time (JAN2030)),
|
||||
|
||||
/**
|
||||
* Should return 1 new key, + the original one. NOTE: the
|
||||
* original DK will never be 'cancelled' as for the current
|
||||
@ -187,7 +181,6 @@ run (void *cls,
|
||||
2, /* generation */
|
||||
2,
|
||||
TTH_parse_time (JAN2030)),
|
||||
|
||||
TALER_TESTING_cmd_exec_keyup_with_now
|
||||
("keyup-3",
|
||||
CONFIG_FILE_EXTENDED_2,
|
||||
@ -200,7 +193,7 @@ run (void *cls,
|
||||
/**
|
||||
* Expected number of DK:
|
||||
*
|
||||
* 3500 (the lookaeahd_sign time frame, in seconds)
|
||||
* 3500 (the lookahead_sign time frame, in seconds)
|
||||
* - 69 (how many seconds are covered by the latest DK)
|
||||
* ----
|
||||
* 3431
|
||||
@ -242,7 +235,7 @@ main (int argc,
|
||||
/* These environment variables get in the way... */
|
||||
unsetenv ("XDG_DATA_HOME");
|
||||
unsetenv ("XDG_CONFIG_HOME");
|
||||
GNUNET_log_setup ("test-exchange-api-cherry-picking-new",
|
||||
GNUNET_log_setup ("test-exchange-api-cherry-picking",
|
||||
"DEBUG",
|
||||
NULL);
|
||||
TALER_TESTING_cleanup_files (CONFIG_FILE);
|
||||
@ -276,4 +269,4 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* end of test_exchange_api_keys_cherry_picking_new.c */
|
||||
/* end of test_exchange_api_keys_cherry_picking.c */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of TALER
|
||||
Copyright (C) 2018 Taler Systems SA
|
||||
Copyright (C) 2018, 2019 Taler Systems SA
|
||||
|
||||
TALER is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
@ -18,8 +18,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file exchange-lib/test_exchange_api_keys_cherry_picking_new.c
|
||||
* @brief testcase to test exchange's /keys cherry picking ability
|
||||
* @file exchange-lib/test_exchange_api_overlapping_keys_bug.c
|
||||
* @brief testcase to test exchange's /keys cherry picking ability and
|
||||
* other /keys related operations
|
||||
* @author Marcello Stanisci
|
||||
* @author Christian Grothoff
|
||||
*/
|
||||
@ -35,16 +36,6 @@
|
||||
#include "taler_fakebank_lib.h"
|
||||
#include "taler_testing_lib.h"
|
||||
|
||||
/**
|
||||
* XXX:
|
||||
*
|
||||
* This test case aims at reproducing one bug that appears
|
||||
* when some /keys are redownloaded (although already owned
|
||||
* by the client). In particular, the bug makes signature
|
||||
* verifications to fail (often times, auditor signatures
|
||||
* have proven to be faulty).
|
||||
*/
|
||||
|
||||
/**
|
||||
* Configuration file we use. One (big) configuration is used
|
||||
* for the various components for this test.
|
||||
@ -84,13 +75,10 @@ static void
|
||||
run (void *cls,
|
||||
struct TALER_TESTING_Interpreter *is)
|
||||
{
|
||||
|
||||
struct TALER_TESTING_Command commands[] = {
|
||||
|
||||
TALER_TESTING_cmd_check_keys ("first-download",
|
||||
1,
|
||||
1),
|
||||
|
||||
/* Causes GET /keys?last_denom_issue=0 */
|
||||
TALER_TESTING_cmd_check_keys_with_last_denom ("second-download",
|
||||
3,
|
||||
@ -111,7 +99,7 @@ main (int argc,
|
||||
/* These environment variables get in the way... */
|
||||
unsetenv ("XDG_DATA_HOME");
|
||||
unsetenv ("XDG_CONFIG_HOME");
|
||||
GNUNET_log_setup ("test-exchange-api-cherry-picking-new",
|
||||
GNUNET_log_setup ("test-exchange-api-overlapping-keys-bug",
|
||||
"DEBUG", NULL);
|
||||
TALER_TESTING_cleanup_files (CONFIG_FILE);
|
||||
/* @helpers. Run keyup, create tables, ... Note: it
|
||||
@ -144,4 +132,4 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* end of test_exchange_api_keys_cherry_picking_new.c */
|
||||
/* end of test_exchange_api_overlapping_keys_bug.c */
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "taler_testing_lib.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* State for a "auditor sign" CMD.
|
||||
*/
|
||||
@ -217,7 +216,7 @@ TALER_TESTING_cmd_exec_auditor_sign (const char *label,
|
||||
ass = GNUNET_new (struct AuditorSignState);
|
||||
ass->config_filename = config_filename;
|
||||
|
||||
|
||||
{
|
||||
struct TALER_TESTING_Command cmd = {
|
||||
.cls = ass,
|
||||
.label = label,
|
||||
@ -228,5 +227,6 @@ TALER_TESTING_cmd_exec_auditor_sign (const char *label,
|
||||
|
||||
return cmd;
|
||||
}
|
||||
}
|
||||
|
||||
/* end of testing_api_cmd_exec_auditor-sign.c */
|
||||
|
@ -76,6 +76,7 @@ struct ConnectWithStateState
|
||||
struct TALER_TESTING_Interpreter *is;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Run the command.
|
||||
*
|
||||
@ -109,7 +110,7 @@ serialize_keys_run (void *cls,
|
||||
* @param cls closure.
|
||||
* @param cmd the command which is being cleaned up.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
serialize_keys_cleanup (void *cls,
|
||||
const struct TALER_TESTING_Command *cmd)
|
||||
{
|
||||
@ -119,7 +120,6 @@ serialize_keys_cleanup (void *cls,
|
||||
{
|
||||
json_decref (sks->keys);
|
||||
}
|
||||
|
||||
GNUNET_free ((char *) sks->exchange_url);
|
||||
GNUNET_free (sks);
|
||||
}
|
||||
@ -142,9 +142,7 @@ serialize_keys_traits (void *cls,
|
||||
unsigned int index)
|
||||
{
|
||||
struct SerializeKeysState *sks = cls;
|
||||
|
||||
struct TALER_TESTING_Trait traits[] = {
|
||||
|
||||
TALER_TESTING_make_trait_exchange_keys (0, sks->keys),
|
||||
TALER_TESTING_make_trait_url (0, sks->exchange_url),
|
||||
TALER_TESTING_trait_end ()
|
||||
@ -230,7 +228,7 @@ connect_with_state_run (void *cls,
|
||||
* @param cls closure.
|
||||
* @param cmd the command which is being cleaned up.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
connect_with_state_cleanup
|
||||
(void *cls,
|
||||
const struct TALER_TESTING_Command *cmd)
|
||||
@ -240,6 +238,7 @@ connect_with_state_cleanup
|
||||
GNUNET_free (cwss);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make a serialize-keys CMD. It will ask for
|
||||
* keys serialization __and__ disconnect from the
|
||||
@ -265,6 +264,7 @@ TALER_TESTING_cmd_serialize_keys (const char *label)
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make a connect-with-state CMD. This command
|
||||
* will use a serialized key state to reconnect
|
||||
|
Loading…
Reference in New Issue
Block a user