mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
g10: Improve TOFU batch update code.
* g10/gpg.h (tofu): Rename field batch_update_ref to batch_updated_wanted. * g10/tofu.c (struct tofu_dbs_s): Rename field batch_update to in_batch_transaction. (begin_transaction): Only end an extant batch transaction if we are not in a normal transaction. When ending a batch transaction, really end it. Update ctrl->tofu.batch_update_started when starting a batch transaction. (end_transaction): Only release a batch transaction if ONLY_BATCH is true. When releasing a batch transaction, assert that there is no open normal transaction. Only allow DBS to be NULL if ONLY_BATCH is true. (tofu_begin_batch_update): Don't update ctrl->tofu.batch_update_started. (opendbs): Call end_transaction unconditionally. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>
This commit is contained in:
parent
3beeaa70bd
commit
371ae66e9d
2 changed files with 64 additions and 46 deletions
|
@ -83,7 +83,7 @@ struct server_control_s
|
|||
struct {
|
||||
tofu_dbs_t dbs;
|
||||
int in_transaction;
|
||||
int batch_update_ref;
|
||||
int batch_updated_wanted;
|
||||
time_t batch_update_started;
|
||||
} tofu;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue