fix indent

This commit is contained in:
Christian Grothoff 2019-08-01 00:24:11 +02:00
parent 5b2efa2b06
commit 8f7388042c
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
8 changed files with 56 additions and 74 deletions

View File

@ -417,7 +417,8 @@ handle_mhd_request (void *cls,
struct GNUNET_AsyncScopeSave old_scope; struct GNUNET_AsyncScopeSave old_scope;
const char *correlation_id = NULL; const char *correlation_id = NULL;
if (NULL == ecls) { if (NULL == ecls)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Handling new request\n"); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Handling new request\n");
/* We're in a new async scope! */ /* We're in a new async scope! */
ecls = *con_cls = GNUNET_new (struct ExchangeHttpRequestClosure); ecls = *con_cls = GNUNET_new (struct ExchangeHttpRequestClosure);
@ -435,9 +436,7 @@ handle_mhd_request (void *cls,
} }
inner_cls = &ecls->opaque_post_parsing_context; inner_cls = &ecls->opaque_post_parsing_context;
GNUNET_async_scope_enter (&ecls->async_scope_id, &old_scope); GNUNET_async_scope_enter (&ecls->async_scope_id, &old_scope);
if (NULL != correlation_id) if (NULL != correlation_id)
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Handling request (%s) for URL '%s', correlation_id=%s\n", "Handling request (%s) for URL '%s', correlation_id=%s\n",
@ -462,6 +461,8 @@ handle_mhd_request (void *cls,
(0 == strcasecmp (method, (0 == strcasecmp (method,
rh->method)) ) ) rh->method)) ) )
{ {
/* FIXME: consider caching 'rh' in '**connection_cls' to
avoid repeated lookup! */
ret = rh->handler (rh, ret = rh->handler (rh,
connection, connection,
inner_cls, inner_cls,
@ -477,7 +478,6 @@ handle_mhd_request (void *cls,
upload_data, upload_data,
upload_data_size); upload_data_size);
GNUNET_async_scope_restore (&old_scope); GNUNET_async_scope_restore (&old_scope);
return ret; return ret;
} }

View File

@ -442,6 +442,7 @@ TALER_EXCHANGE_set_now (struct TALER_EXCHANGE_Handle *exchange,
void void
TALER_EXCHANGE_unset_now (struct TALER_EXCHANGE_Handle *exchange); TALER_EXCHANGE_unset_now (struct TALER_EXCHANGE_Handle *exchange);
/** /**
* Let the user set the last valid denomination time manually. * Let the user set the last valid denomination time manually.
* *

View File

@ -16,14 +16,12 @@
License along with TALER; see the file COPYING. If not, see License along with TALER; see the file COPYING. If not, see
<http://www.gnu.org/licenses/> <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file exchange-lib/test_exchange_api_keys_cherry_picking.c * @file exchange-lib/test_exchange_api_keys_cherry_picking.c
* @brief testcase to test exchange's /keys cherry picking ability * @brief testcase to test exchange's /keys cherry picking ability
* @author Marcello Stanisci * @author Marcello Stanisci
* @author Christian Grothoff * @author Christian Grothoff
*/ */
#include "platform.h" #include "platform.h"
#include "taler_util.h" #include "taler_util.h"
#include "taler_signatures.h" #include "taler_signatures.h"
@ -95,6 +93,7 @@ static char *exchange_url;
*/ */
static char *auditor_url; static char *auditor_url;
/** /**
* Wrapper around the time parser. * Wrapper around the time parser.
* *
@ -118,16 +117,15 @@ TTH_parse_time (const char *str)
* run. * run.
* *
* @param cls closure * @param cls closure
* @param is[in,out] interpreter state
*/ */
static void static void
run (void *cls, run (void *cls,
struct TALER_TESTING_Interpreter *is) struct TALER_TESTING_Interpreter *is)
{ {
struct TALER_TESTING_Command keys_serialization[] = { struct TALER_TESTING_Command keys_serialization[] = {
TALER_TESTING_cmd_serialize_keys TALER_TESTING_cmd_serialize_keys
("serialize-keys"), ("serialize-keys"),
TALER_TESTING_cmd_connect_with_state TALER_TESTING_cmd_connect_with_state
("reconnect-with-state", ("reconnect-with-state",
"serialize-keys"), "serialize-keys"),
@ -152,13 +150,10 @@ run (void *cls,
"x-taler-bank", "x-taler-bank",
NULL, NULL,
MHD_HTTP_OK), MHD_HTTP_OK),
TALER_TESTING_cmd_end (), TALER_TESTING_cmd_end (),
}; };
struct TALER_TESTING_Command ordinary_cherry_pick[] = { struct TALER_TESTING_Command ordinary_cherry_pick[] = {
/** /**
* 1 DK with 80s withdraw duration, lookahead_sign is 60s * 1 DK with 80s withdraw duration, lookahead_sign is 60s
* => expect 1 DK. * => expect 1 DK.
@ -176,7 +171,6 @@ run (void *cls,
("keyup-1", ("keyup-1",
CONFIG_FILE, CONFIG_FILE,
TTH_parse_time (JAN2030)), TTH_parse_time (JAN2030)),
/** /**
* Should return 1 new key, + the original one. NOTE: the * Should return 1 new key, + the original one. NOTE: the
* original DK will never be 'cancelled' as for the current * original DK will never be 'cancelled' as for the current
@ -187,7 +181,6 @@ run (void *cls,
2, /* generation */ 2, /* generation */
2, 2,
TTH_parse_time (JAN2030)), TTH_parse_time (JAN2030)),
TALER_TESTING_cmd_exec_keyup_with_now TALER_TESTING_cmd_exec_keyup_with_now
("keyup-3", ("keyup-3",
CONFIG_FILE_EXTENDED_2, CONFIG_FILE_EXTENDED_2,
@ -200,7 +193,7 @@ run (void *cls,
/** /**
* Expected number of DK: * 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) * - 69 (how many seconds are covered by the latest DK)
* ---- * ----
* 3431 * 3431
@ -242,7 +235,7 @@ main (int argc,
/* These environment variables get in the way... */ /* These environment variables get in the way... */
unsetenv ("XDG_DATA_HOME"); unsetenv ("XDG_DATA_HOME");
unsetenv ("XDG_CONFIG_HOME"); unsetenv ("XDG_CONFIG_HOME");
GNUNET_log_setup ("test-exchange-api-cherry-picking-new", GNUNET_log_setup ("test-exchange-api-cherry-picking",
"DEBUG", "DEBUG",
NULL); NULL);
TALER_TESTING_cleanup_files (CONFIG_FILE); TALER_TESTING_cleanup_files (CONFIG_FILE);
@ -276,4 +269,4 @@ main (int argc,
return 0; return 0;
} }
/* end of test_exchange_api_keys_cherry_picking_new.c */ /* end of test_exchange_api_keys_cherry_picking.c */

View File

@ -1,6 +1,6 @@
/* /*
This file is part of TALER 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 TALER is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published 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 * @file exchange-lib/test_exchange_api_overlapping_keys_bug.c
* @brief testcase to test exchange's /keys cherry picking ability * @brief testcase to test exchange's /keys cherry picking ability and
* other /keys related operations
* @author Marcello Stanisci * @author Marcello Stanisci
* @author Christian Grothoff * @author Christian Grothoff
*/ */
@ -35,16 +36,6 @@
#include "taler_fakebank_lib.h" #include "taler_fakebank_lib.h"
#include "taler_testing_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 * Configuration file we use. One (big) configuration is used
* for the various components for this test. * for the various components for this test.
@ -84,13 +75,10 @@ static void
run (void *cls, run (void *cls,
struct TALER_TESTING_Interpreter *is) struct TALER_TESTING_Interpreter *is)
{ {
struct TALER_TESTING_Command commands[] = { struct TALER_TESTING_Command commands[] = {
TALER_TESTING_cmd_check_keys ("first-download", TALER_TESTING_cmd_check_keys ("first-download",
1, 1,
1), 1),
/* Causes GET /keys?last_denom_issue=0 */ /* Causes GET /keys?last_denom_issue=0 */
TALER_TESTING_cmd_check_keys_with_last_denom ("second-download", TALER_TESTING_cmd_check_keys_with_last_denom ("second-download",
3, 3,
@ -111,7 +99,7 @@ main (int argc,
/* These environment variables get in the way... */ /* These environment variables get in the way... */
unsetenv ("XDG_DATA_HOME"); unsetenv ("XDG_DATA_HOME");
unsetenv ("XDG_CONFIG_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); "DEBUG", NULL);
TALER_TESTING_cleanup_files (CONFIG_FILE); TALER_TESTING_cleanup_files (CONFIG_FILE);
/* @helpers. Run keyup, create tables, ... Note: it /* @helpers. Run keyup, create tables, ... Note: it
@ -144,4 +132,4 @@ main (int argc,
return 0; return 0;
} }
/* end of test_exchange_api_keys_cherry_picking_new.c */ /* end of test_exchange_api_overlapping_keys_bug.c */

View File

@ -30,7 +30,6 @@
#include "taler_testing_lib.h" #include "taler_testing_lib.h"
/** /**
* State for a "auditor sign" CMD. * 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 = GNUNET_new (struct AuditorSignState);
ass->config_filename = config_filename; ass->config_filename = config_filename;
{
struct TALER_TESTING_Command cmd = { struct TALER_TESTING_Command cmd = {
.cls = ass, .cls = ass,
.label = label, .label = label,
@ -227,6 +226,7 @@ TALER_TESTING_cmd_exec_auditor_sign (const char *label,
}; };
return cmd; return cmd;
}
} }
/* end of testing_api_cmd_exec_auditor-sign.c */ /* end of testing_api_cmd_exec_auditor-sign.c */

View File

@ -76,6 +76,7 @@ struct ConnectWithStateState
struct TALER_TESTING_Interpreter *is; struct TALER_TESTING_Interpreter *is;
}; };
/** /**
* Run the command. * Run the command.
* *
@ -109,7 +110,7 @@ serialize_keys_run (void *cls,
* @param cls closure. * @param cls closure.
* @param cmd the command which is being cleaned up. * @param cmd the command which is being cleaned up.
*/ */
void static void
serialize_keys_cleanup (void *cls, serialize_keys_cleanup (void *cls,
const struct TALER_TESTING_Command *cmd) const struct TALER_TESTING_Command *cmd)
{ {
@ -119,7 +120,6 @@ serialize_keys_cleanup (void *cls,
{ {
json_decref (sks->keys); json_decref (sks->keys);
} }
GNUNET_free ((char *) sks->exchange_url); GNUNET_free ((char *) sks->exchange_url);
GNUNET_free (sks); GNUNET_free (sks);
} }
@ -142,9 +142,7 @@ serialize_keys_traits (void *cls,
unsigned int index) unsigned int index)
{ {
struct SerializeKeysState *sks = cls; struct SerializeKeysState *sks = cls;
struct TALER_TESTING_Trait traits[] = { struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_exchange_keys (0, sks->keys), TALER_TESTING_make_trait_exchange_keys (0, sks->keys),
TALER_TESTING_make_trait_url (0, sks->exchange_url), TALER_TESTING_make_trait_url (0, sks->exchange_url),
TALER_TESTING_trait_end () TALER_TESTING_trait_end ()
@ -230,7 +228,7 @@ connect_with_state_run (void *cls,
* @param cls closure. * @param cls closure.
* @param cmd the command which is being cleaned up. * @param cmd the command which is being cleaned up.
*/ */
void static void
connect_with_state_cleanup connect_with_state_cleanup
(void *cls, (void *cls,
const struct TALER_TESTING_Command *cmd) const struct TALER_TESTING_Command *cmd)
@ -240,6 +238,7 @@ connect_with_state_cleanup
GNUNET_free (cwss); GNUNET_free (cwss);
} }
/** /**
* Make a serialize-keys CMD. It will ask for * Make a serialize-keys CMD. It will ask for
* keys serialization __and__ disconnect from the * keys serialization __and__ disconnect from the
@ -265,6 +264,7 @@ TALER_TESTING_cmd_serialize_keys (const char *label)
return cmd; return cmd;
} }
/** /**
* Make a connect-with-state CMD. This command * Make a connect-with-state CMD. This command
* will use a serialized key state to reconnect * will use a serialized key state to reconnect