g10: Support nested transactions on the TOFU DB.
authorNeal H. Walfield <neal@g10code.com>
Mon, 29 Aug 2016 13:13:45 +0000 (15:13 +0200)
committerNeal H. Walfield <neal@g10code.com>
Tue, 30 Aug 2016 13:54:41 +0000 (15:54 +0200)
commit33e97813d72996d22a295773c64261f5588ce9dd
tree59c4bc3d646c18bfa0810878b009d0f9e917b9f0
parent4c2abb221b29c9e8e0876fe986472b562ee1c99f
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 <neal@g10code.com>
g10/gpg.h
g10/tofu.c