From 33e97813d72996d22a295773c64261f5588ce9dd Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 29 Aug 2016 15:13:45 +0200 Subject: g10: Support nested transactions on the TOFU DB. * g10/gpg.h (struct server_control_s): New field in_transaction. * g10/tofu.c (struct tofu_dbs_s): Remove fields savepoint_inner and savepoint_inner_commit. (begin_transaction): Increment CTRL->TOFU.IN_TRANSACTION. Name the savepoint according to the nesting level. (end_transaction): Name the savepoint according to the nesting level. Decrement CTRL->TOFU.IN_TRANSACTION. (rollback_transaction): Likewise. Only ever rollback a non-batch transaction. (opendbs): Assert that there are no outstanding transactions. -- Signed-off-by: Neal H. Walfield --- g10/gpg.h | 1 + 1 file changed, 1 insertion(+) (limited to 'g10/gpg.h') diff --git a/g10/gpg.h b/g10/gpg.h index 1aaff2f4f..154da0de4 100644 --- a/g10/gpg.h +++ b/g10/gpg.h @@ -82,6 +82,7 @@ struct server_control_s /* Local data for tofu.c */ struct { tofu_dbs_t dbs; + int in_transaction; int batch_update_ref; time_t batch_update_started; } tofu; -- cgit v1.2.3