anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

commit bf3169b6feb3166632e9f487a62b087c3f4f6ea8
parent 6833be40c01aa31eb0c461b00b2aed8e4ae68089
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Wed,  1 Jul 2026 17:04:44 +0200

fix #11593

Diffstat:
Msrc/stasis/anastasis-db_pg.c | 7++++++-
Msrc/stasis/anastasis-db_pg.h | 13+++++++------
2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/stasis/anastasis-db_pg.c b/src/stasis/anastasis-db_pg.c @@ -28,6 +28,11 @@ /** + * Prepared statements have been initialized in this edition. + */ +uint64_t ANASTASIS_DB_prep_gen_; + +/** * Global database state. */ struct PostgresClosure *pg; @@ -170,7 +175,7 @@ reconnect_cb (void *cls, GNUNET_break (0); return; } - pg->prep_gen++; + ANASTASIS_DB_prep_gen_++; } diff --git a/src/stasis/anastasis-db_pg.h b/src/stasis/anastasis-db_pg.h @@ -69,14 +69,15 @@ struct PostgresClosure */ char *currency; - /** - * Prepared statements have been initialized in this edition. - */ - uint64_t prep_gen; }; /** + * Prepared statements have been initialized in this edition. + */ +extern uint64_t ANASTASIS_DB_prep_gen_; + +/** * Global database state, initialized by ANASTASIS_DB_init(). */ extern struct PostgresClosure *pg; @@ -93,7 +94,7 @@ extern struct PostgresClosure *pg; do { \ static unsigned long long gen; \ \ - if (gen < pg->prep_gen) \ + if (gen < ANASTASIS_DB_prep_gen_) \ { \ struct GNUNET_PQ_PreparedStatement ps[] = { \ GNUNET_PQ_make_prepare (name, sql), \ @@ -107,7 +108,7 @@ extern struct PostgresClosure *pg; GNUNET_break (0); \ return GNUNET_DB_STATUS_HARD_ERROR; \ } \ - gen = pg->prep_gen; \ + gen = ANASTASIS_DB_prep_gen_; \ } \ } while (0)