#
#
# patch "ChangeLog"
# from [984b57ef7fb1d96de67bd16fdfcf18692ce56f84]
# to [05d45c418dca0f3e786acf4fb361ad450de78a2d]
#
# patch "key_store.cc"
# from [6172f23db28ae65b163cad20e26448cf596ec896]
# to [7a33f02a482db43ad119b210848f3fdb9a306ba0]
#
============================================================
--- ChangeLog 984b57ef7fb1d96de67bd16fdfcf18692ce56f84
+++ ChangeLog 05d45c418dca0f3e786acf4fb361ad450de78a2d
@@ -1,3 +1,8 @@
+2006-03-22 Nathaniel Smith
+
+ * key_store.cc (consume_key_pair, read_key_dir)
+ (ensure_in_database, write_key): Add some logging.
+
2006-03-14 Nathaniel Smith
* revision.cc (construct_revisions_from_ancestry): Now with 17%
============================================================
--- key_store.cc 6172f23db28ae65b163cad20e26448cf596ec896
+++ key_store.cc 7a33f02a482db43ad119b210848f3fdb9a306ba0
@@ -33,13 +33,14 @@
virtual void consume_key_pair(rsa_keypair_id const & ident,
keypair const & kp)
{
+ L(FL("reading key pair '%s' from key store") % ident);
E(!ks->key_pair_exists(ident),
F("Key store has multiple keys with id '%s'.") % ident);
ks->keys.insert(std::make_pair(ident, kp));
hexenc hash;
key_hash_code(ident, kp.pub, hash);
ks->hashes.insert(std::make_pair(hash, ident));
- L(FL("Read key pair '%s' from key store.") % ident);
+ L(FL("successfully read key pair '%s' from key store") % ident);
}
};
@@ -64,11 +65,17 @@
{
std::vector key_files, dirs;
if (directory_exists(key_dir))
- read_directory(key_dir, key_files, dirs);
+ {
+ L(FL("reading key dir '%s'") % key_dir);
+ read_directory(key_dir, key_files, dirs);
+ }
+ else
+ L(FL("key dir '%s' does not exist") % key_dir);
keyreader kr(this);
for (std::vector::const_iterator i = key_files.begin();
i != key_files.end(); ++i)
{
+ L(FL("reading keys from file '%s'") % (*i));
data dat;
read_data(key_dir / (*i)(), dat);
std::istringstream is(dat());
@@ -90,10 +97,14 @@
{
maybe_read_key_dir();
if (app->db.public_key_exists(ident))
- return;
+ {
+ L(FL("public key '%s' is already in db, not loading") % ident);
+ return;
+ }
std::map::iterator i = keys.find(ident);
I(i != keys.end());
app->db.put_key(ident, i->second.pub);
+ L(FL("loaded public key '%s' into db") % ident);
}
bool
@@ -187,6 +198,7 @@
data dat(oss.str());
system_path file;
get_key_file(ident, file);
+ L(FL("writing key '%s' to file '%s' in dir '%s'") % ident % file % key_dir);
write_data(file, dat, key_dir);
}