diff options
author | Neal H. Walfield <neal@g10code.com> | 2015-12-15 13:09:27 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@g10code.com> | 2015-12-15 13:09:50 +0100 |
commit | f369efd6712148dc7ed40dba6d1ff5b0e169431a (patch) | |
tree | 49ee59d35181b65a7f7062b6235db207870020d7 /g10/keydb.c | |
parent | gpg: Improve the keyblock cache's transparency. (diff) | |
download | gnupg2-f369efd6712148dc7ed40dba6d1ff5b0e169431a.tar.xz gnupg2-f369efd6712148dc7ed40dba6d1ff5b0e169431a.zip |
gpg: Improve the keyblock cache's transparency.
* kbx/keybox-search.c (keybox_seek): New function.
* g10/keydb.c (keydb_search): When reading from the cache, seek to
just after the cached record.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Diffstat (limited to 'g10/keydb.c')
-rw-r--r-- | g10/keydb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/g10/keydb.c b/g10/keydb.c index 860187fde..b30819963 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -1717,6 +1717,12 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc, /* (DESCINDEX is already set). */ if (DBG_CLOCK) log_clock ("keydb_search leave (cached)"); + + hd->current = hd->keyblock_cache.resource; + /* HD->KEYBLOCK_CACHE.OFFSET is the last byte in the record. + Seek just beyond that. */ + keybox_seek (hd->active[hd->current].u.kb, + hd->keyblock_cache.offset + 1); return 0; } |