size_t Ssl::CertificateDb::readSize() const
{
- std::ifstream size_file(size_full.c_str());
- if (!size_file && enabled_disk_store)
+ std::ifstream ifstr(size_full.c_str());
+ if (!ifstr && enabled_disk_store)
throw std::runtime_error("cannot open for reading: " + size_full);
size_t db_size = 0;
- if (!(size_file >> db_size))
+ if (!(ifstr >> db_size))
throw std::runtime_error("error while reading " + size_full);
return db_size;
}
void Ssl::CertificateDb::writeSize(size_t db_size)
{
- std::ofstream size_file(size_full.c_str());
- if (!size_file && enabled_disk_store)
+ std::ofstream ofstr(size_full.c_str());
+ if (!ofstr && enabled_disk_store)
throw std::runtime_error("cannot write \"" + size_full + "\" file");
- size_file << db_size;
+ ofstr << db_size;
}
size_t Ssl::CertificateDb::getFileSize(std::string const & filename)