g10: Be careful to not be in a transaction during long operations
authorNeal H. Walfield <neal@g10code.com>
Thu, 1 Sep 2016 10:42:44 +0000 (12:42 +0200)
committerNeal H. Walfield <neal@g10code.com>
Thu, 1 Sep 2016 10:43:34 +0000 (12:43 +0200)
commit4cbd2a690c5e5ed2dff49c1f4fc867b31fca689a
tree6b25a27ad61b0249f3fd55e2ff86e0361a5a69d5
parentbabeb6f8a9b1f8341652145bad58be6cd49e0712
g10: Be careful to not be in a transaction during long operations

* g10/tofu.c (begin_transaction): New parameter only_batch.  If set,
only start a batch transaction if there is none and one has been
requested.  Update callers.
(tofu_suspend_batch_transaction): New function.
(tofu_resume_batch_transaction): Likewise.
(ask_about_binding): Take a ctrl_t, not a tofu_dbs_t.  Update
callers.  Gather statistics within a transaction.  Suspend any batch
transaction when getting user input.
(get_trust): Take a ctrl_t, not a tofu_dbs_t.  Update callers.
Enclose in a transaction.
(tofu_get_validity): Use a batch transaction, not a normal
transaction.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
g10/tofu.c