g10: Don't cache search results if the search didn't scan the whole DB.
authorNeal H. Walfield <neal@g10code.com>
Mon, 31 Aug 2015 07:47:58 +0000 (09:47 +0200)
committerNeal H. Walfield <neal@g10code.com>
Mon, 31 Aug 2015 09:30:55 +0000 (11:30 +0200)
commitefd1ead9e779eb3bd37384258e08ad921a934612
tree90c455b3f9c80e5d0a0aca8dc59a2d7299641b68
parent11d8ffc939a4d20cfb0082b2d966b1e1a7d61f8d
g10: Don't cache search results if the search didn't scan the whole DB.

* g10/keydb.c (struct keydb_handle): Add new field is_reset.
(keydb_new): Initialize hd->is_reset to 1.
(keydb_locate_writable): Set hd->is_reset to 1.
(keydb_search): Set hd->is_reset to 0.  Don't cache a key not found if
the search started from the beginning of the database.

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