summaryrefslogtreecommitdiffstats
path: root/kbx
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-08-23 15:44:05 +0200
committerWerner Koch <wk@gnupg.org>2019-08-23 15:44:05 +0200
commit5ef0d7a795cf2462314ea0cb72c7efa7243ab405 (patch)
tree2758b95bdc68a58c600ee56a496cb4647f23fef0 /kbx
parentkbx: Fix regression in compression trigger from July 18 (diff)
downloadgnupg2-5ef0d7a795cf2462314ea0cb72c7efa7243ab405.tar.xz
gnupg2-5ef0d7a795cf2462314ea0cb72c7efa7243ab405.zip
kbx: Include deleted records into the --stats output.
* kbx/keybox-dump.c (_keybox_dump_file): Take deleted records in account. -- This also changes the numbering of the records to reflect the real record number. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'kbx')
-rw-r--r--kbx/keybox-dump.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kbx/keybox-dump.c b/kbx/keybox-dump.c
index 48c3f63c5..c595208d0 100644
--- a/kbx/keybox-dump.c
+++ b/kbx/keybox-dump.c
@@ -585,6 +585,7 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp)
int rc;
unsigned long count = 0;
struct file_stats_s stats;
+ int skipped_deleted;
memset (&stats, 0, sizeof stats);
@@ -593,7 +594,7 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp)
for (;;)
{
- rc = _keybox_read_blob (&blob, fp, NULL);
+ rc = _keybox_read_blob (&blob, fp, &skipped_deleted);
if (gpg_err_code (rc) == GPG_ERR_TOO_LARGE
&& gpg_err_source (rc) == GPG_ERR_SOURCE_KEYBOX)
{
@@ -610,8 +611,12 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp)
if (rc)
break;
+ count += skipped_deleted;
+
if (stats_only)
{
+ stats.total_blob_count += skipped_deleted;
+ stats.empty_blob_count += skipped_deleted;
update_stats (blob, &stats);
}
else