diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-30 10:58:32 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-30 10:58:32 +0200 |
commit | 6f5288a2457054e31f1710865c759895acbead81 (patch) | |
tree | 250e4460ca09f543327b8e6c7cb2ca2830b26d4b | |
parent | f9441ca8541756e454a6560f8f7dc11afd8b300c (diff) |
update use to match new GNUnet scheduler API
-rw-r--r-- | src/backend/taler-merchant-httpd.c | 11 | ||||
-rw-r--r-- | src/tests/test_contract.c | 18 |
2 files changed, 10 insertions, 19 deletions
diff --git a/src/backend/taler-merchant-httpd.c b/src/backend/taler-merchant-httpd.c index 01dea3fd..38a571bf 100644 --- a/src/backend/taler-merchant-httpd.c +++ b/src/backend/taler-merchant-httpd.c @@ -81,11 +81,6 @@ struct GNUNET_TIME_Relative edate_delay; char *TMH_merchant_currency_string; /** - * Shutdown task identifier - */ -static struct GNUNET_SCHEDULER_Task *shutdown_task; - -/** * Task running the HTTP server. */ static struct GNUNET_SCHEDULER_Task *mhd_task; @@ -473,10 +468,8 @@ run (void *cls, wireformat = NULL; result = GNUNET_SYSERR; - shutdown_task = - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, - &do_shutdown, - NULL); + GNUNET_SCHEDULER_add_shutdown (&do_shutdown, + NULL); if (GNUNET_SYSERR == TMH_EXCHANGES_init (config)) { diff --git a/src/tests/test_contract.c b/src/tests/test_contract.c index 1e652567..2e032334 100644 --- a/src/tests/test_contract.c +++ b/src/tests/test_contract.c @@ -35,12 +35,12 @@ struct GNUNET_CRYPTO_EddsaPrivateKey *privkey; char *keyfile; static int result; static struct MERCHANT_WIREFORMAT_Sepa *wire; -static struct GNUNET_SCHEDULER_Task *shutdown_task; extern struct MERCHANT_WIREFORMAT_Sepa * TALER_MERCHANT_parse_wireformat_sepa (const struct GNUNET_CONFIGURATION_Handle *cfg); + /** * Shutdown task (magically invoked when the application is being * quit) @@ -49,7 +49,8 @@ TALER_MERCHANT_parse_wireformat_sepa (const struct GNUNET_CONFIGURATION_Handle * * @param tc scheduler task context */ static void -do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) +do_shutdown (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc) { if (NULL != db_conn) @@ -59,11 +60,12 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } } + extern uint32_t TALER_MERCHANTDB_contract_get_values (PGconn *conn, - const struct GNUNET_HashCode *h_contract, - uint64_t *nounce, - struct GNUNET_TIME_Absolute *edate); + const struct GNUNET_HashCode *h_contract, + uint64_t *nounce, + struct GNUNET_TIME_Absolute *edate); /** @@ -133,8 +135,7 @@ run (void *cls, char *const *args, const char *cfgfile, privkey = GNUNET_CRYPTO_eddsa_key_create_from_file (keyfile); wire = TALER_MERCHANT_parse_wireformat_sepa (config); - shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, - &do_shutdown, NULL); + GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); /** * 'Root' object of the contract, leaving some holes to bi filled @@ -333,7 +334,4 @@ main (int argc, char *const *argv) options, &run, NULL)) return 3; return (GNUNET_OK == result) ? 0 : 1; - - - } |