summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/authorization/anastasis_authorization_plugin_iban.c2
-rw-r--r--src/include/anastasis_database_plugin.h2
-rw-r--r--src/stasis/plugin_anastasis_postgres.c5
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,
&espec.debit_iban_hash);
as->eh = ctx->ac->db->event_listen (ctx->ac->db->cls,
&espec.header,
+ GNUNET_TIME_absolute_get_remaining (
+ timeout),
&bank_event_cb,
as);
}
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
*
* @param cls database context to use
* @param es specification of the event to listen for
+ * @param timeout how long to wait for the event
* @param cb function to call when the event happens, possibly
* multiple times (until cancel is invoked)
* @param cb_cls closure for @a cb
@@ -270,6 +271,7 @@ struct ANASTASIS_DatabasePlugin
struct GNUNET_DB_EventHandler *
(*event_listen)(void *cls,
const struct GNUNET_DB_EventHeaderP *es,
+ struct GNUNET_TIME_Relative timeout,
GNUNET_DB_EventCallback cb,
void *cb_cls);
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)
*
* @param cls database context to use
* @param es specification of the event to listen for
+ * @param timeout how long to wait for the event
* @param cb function to call when the event happens, possibly
* multiple times (until cancel is invoked)
* @param cb_cls closure for @a cb
@@ -238,6 +239,7 @@ commit_transaction (void *cls)
static struct GNUNET_DB_EventHandler *
postgres_event_listen (void *cls,
const struct GNUNET_DB_EventHeaderP *es,
+ struct GNUNET_TIME_Relative timeout,
GNUNET_DB_EventCallback cb,
void *cb_cls)
{
@@ -245,6 +247,7 @@ postgres_event_listen (void *cls,
return GNUNET_PQ_event_listen (pg->conn,
es,
+ timeout,
cb,
cb_cls);
}
@@ -2635,7 +2638,6 @@ libanastasis_plugin_db_postgres_init (void *cls)
GNUNET_free (pg);
return NULL;
}
- GNUNET_PQ_event_scheduler_start (pg->conn);
plugin = GNUNET_new (struct ANASTASIS_DatabasePlugin);
plugin->cls = pg;
plugin->drop_tables = &postgres_drop_tables;
@@ -2694,7 +2696,6 @@ libanastasis_plugin_db_postgres_done (void *cls)
struct ANASTASIS_DatabasePlugin *plugin = cls;
struct PostgresClosure *pg = plugin->cls;
- GNUNET_PQ_event_scheduler_stop (pg->conn);
GNUNET_PQ_disconnect (pg->conn);
GNUNET_free (pg->currency);
GNUNET_free (pg);