diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-23 00:17:58 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-23 00:18:03 +0200 |
commit | 6dac69c96aaf84c32802ac8140101df3b8dea60d (patch) | |
tree | 66be3d4b882d54117999fd96d89022c7c0f2d814 | |
parent | 7e4bfbf1c17a5faf04b94e7db04e5536617a4a92 (diff) | |
download | anastasis-6dac69c96aaf84c32802ac8140101df3b8dea60d.tar.gz anastasis-6dac69c96aaf84c32802ac8140101df3b8dea60d.zip |
adjust to latest GNUnet API changes
-rw-r--r-- | src/authorization/anastasis_authorization_plugin_iban.c | 2 | ||||
-rw-r--r-- | src/include/anastasis_database_plugin.h | 2 | ||||
-rw-r--r-- | src/stasis/plugin_anastasis_postgres.c | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_iban.c b/src/authorization/anastasis_authorization_plugin_iban.c index ef11b88..f8a4868 100644 --- a/src/authorization/anastasis_authorization_plugin_iban.c +++ b/src/authorization/anastasis_authorization_plugin_iban.c | |||
@@ -514,6 +514,8 @@ iban_process (struct ANASTASIS_AUTHORIZATION_State *as, | |||
514 | &espec.debit_iban_hash); | 514 | &espec.debit_iban_hash); |
515 | as->eh = ctx->ac->db->event_listen (ctx->ac->db->cls, | 515 | as->eh = ctx->ac->db->event_listen (ctx->ac->db->cls, |
516 | &espec.header, | 516 | &espec.header, |
517 | GNUNET_TIME_absolute_get_remaining ( | ||
518 | timeout), | ||
517 | &bank_event_cb, | 519 | &bank_event_cb, |
518 | as); | 520 | as); |
519 | } | 521 | } |
diff --git a/src/include/anastasis_database_plugin.h b/src/include/anastasis_database_plugin.h index 069d0d9..96a9367 100644 --- a/src/include/anastasis_database_plugin.h +++ b/src/include/anastasis_database_plugin.h | |||
@@ -262,6 +262,7 @@ struct ANASTASIS_DatabasePlugin | |||
262 | * | 262 | * |
263 | * @param cls database context to use | 263 | * @param cls database context to use |
264 | * @param es specification of the event to listen for | 264 | * @param es specification of the event to listen for |
265 | * @param timeout how long to wait for the event | ||
265 | * @param cb function to call when the event happens, possibly | 266 | * @param cb function to call when the event happens, possibly |
266 | * multiple times (until cancel is invoked) | 267 | * multiple times (until cancel is invoked) |
267 | * @param cb_cls closure for @a cb | 268 | * @param cb_cls closure for @a cb |
@@ -270,6 +271,7 @@ struct ANASTASIS_DatabasePlugin | |||
270 | struct GNUNET_DB_EventHandler * | 271 | struct GNUNET_DB_EventHandler * |
271 | (*event_listen)(void *cls, | 272 | (*event_listen)(void *cls, |
272 | const struct GNUNET_DB_EventHeaderP *es, | 273 | const struct GNUNET_DB_EventHeaderP *es, |
274 | struct GNUNET_TIME_Relative timeout, | ||
273 | GNUNET_DB_EventCallback cb, | 275 | GNUNET_DB_EventCallback cb, |
274 | void *cb_cls); | 276 | void *cb_cls); |
275 | 277 | ||
diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c index 4271f53..b7fda3d 100644 --- a/src/stasis/plugin_anastasis_postgres.c +++ b/src/stasis/plugin_anastasis_postgres.c | |||
@@ -230,6 +230,7 @@ commit_transaction (void *cls) | |||
230 | * | 230 | * |
231 | * @param cls database context to use | 231 | * @param cls database context to use |
232 | * @param es specification of the event to listen for | 232 | * @param es specification of the event to listen for |
233 | * @param timeout how long to wait for the event | ||
233 | * @param cb function to call when the event happens, possibly | 234 | * @param cb function to call when the event happens, possibly |
234 | * multiple times (until cancel is invoked) | 235 | * multiple times (until cancel is invoked) |
235 | * @param cb_cls closure for @a cb | 236 | * @param cb_cls closure for @a cb |
@@ -238,6 +239,7 @@ commit_transaction (void *cls) | |||
238 | static struct GNUNET_DB_EventHandler * | 239 | static struct GNUNET_DB_EventHandler * |
239 | postgres_event_listen (void *cls, | 240 | postgres_event_listen (void *cls, |
240 | const struct GNUNET_DB_EventHeaderP *es, | 241 | const struct GNUNET_DB_EventHeaderP *es, |
242 | struct GNUNET_TIME_Relative timeout, | ||
241 | GNUNET_DB_EventCallback cb, | 243 | GNUNET_DB_EventCallback cb, |
242 | void *cb_cls) | 244 | void *cb_cls) |
243 | { | 245 | { |
@@ -245,6 +247,7 @@ postgres_event_listen (void *cls, | |||
245 | 247 | ||
246 | return GNUNET_PQ_event_listen (pg->conn, | 248 | return GNUNET_PQ_event_listen (pg->conn, |
247 | es, | 249 | es, |
250 | timeout, | ||
248 | cb, | 251 | cb, |
249 | cb_cls); | 252 | cb_cls); |
250 | } | 253 | } |
@@ -2635,7 +2638,6 @@ libanastasis_plugin_db_postgres_init (void *cls) | |||
2635 | GNUNET_free (pg); | 2638 | GNUNET_free (pg); |
2636 | return NULL; | 2639 | return NULL; |
2637 | } | 2640 | } |
2638 | GNUNET_PQ_event_scheduler_start (pg->conn); | ||
2639 | plugin = GNUNET_new (struct ANASTASIS_DatabasePlugin); | 2641 | plugin = GNUNET_new (struct ANASTASIS_DatabasePlugin); |
2640 | plugin->cls = pg; | 2642 | plugin->cls = pg; |
2641 | plugin->drop_tables = &postgres_drop_tables; | 2643 | plugin->drop_tables = &postgres_drop_tables; |
@@ -2694,7 +2696,6 @@ libanastasis_plugin_db_postgres_done (void *cls) | |||
2694 | struct ANASTASIS_DatabasePlugin *plugin = cls; | 2696 | struct ANASTASIS_DatabasePlugin *plugin = cls; |
2695 | struct PostgresClosure *pg = plugin->cls; | 2697 | struct PostgresClosure *pg = plugin->cls; |
2696 | 2698 | ||
2697 | GNUNET_PQ_event_scheduler_stop (pg->conn); | ||
2698 | GNUNET_PQ_disconnect (pg->conn); | 2699 | GNUNET_PQ_disconnect (pg->conn); |
2699 | GNUNET_free (pg->currency); | 2700 | GNUNET_free (pg->currency); |
2700 | GNUNET_free (pg); | 2701 | GNUNET_free (pg); |