]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bootstrapped
authorAutomatic source maintenance <squidadm@squid-cache.org>
Thu, 4 Jul 2013 00:10:48 +0000 (18:10 -0600)
committerAutomatic source maintenance <squidadm@squid-cache.org>
Thu, 4 Jul 2013 00:10:48 +0000 (18:10 -0600)
src/Notes.h
src/redirect.cc
src/ssl/certificate_db.cc

index ce9b47fbce26cf6a465ca9df1922be1cbc1c2c12..0068bd233295ada980169fa359186f0fb99ffa5a 100644 (file)
@@ -122,7 +122,7 @@ public:
         MEMPROXY_CLASS(Entry);
     };
 
-    NotePairs(){}
+    NotePairs() {}
     ~NotePairs();
 
     /**
index ec7cd58f6084bd7081025254af16432bdfc8d6bd..854422bb7f77b6d5d326a8d98033378f1306d2be 100644 (file)
@@ -119,7 +119,7 @@ redirectHandleReply(void *data, const HelperReply &reply)
                 // BACKWARD COMPATIBILITY 2012-06-15:
                 // We got HelperReply::Unknown reply result but new
                 // redirectStateData handlers require HelperReply::Okay,
-                // else will drop the helper reply 
+                // else will drop the helper reply
                 newReply.result = HelperReply::Okay;
                 newReply.notes.append(&reply.notes);
 
index 8146ae32e1e0effeef6a4cbaab3921e2aaca585d..f58f84db4ca96c3b20c549113e284ae580628f6b 100644 (file)
@@ -184,8 +184,7 @@ void Ssl::CertificateDb::sq_TXT_DB_delete(TXT_DB *db, const char **row)
 }
 
 #define countof(arr) (sizeof(arr)/sizeof(*arr))
-void Ssl::CertificateDb::sq_TXT_DB_delete_row(TXT_DB *db, int idx)
-{
+void Ssl::CertificateDb::sq_TXT_DB_delete_row(TXT_DB *db, int idx) {
     char **rrow;
 #if SQUID_SSLTXTDB_PSTRINGDATA
     rrow = (char **)sk_OPENSSL_PSTRING_delete(db->data, idx);
@@ -213,29 +212,25 @@ void Ssl::CertificateDb::sq_TXT_DB_delete_row(TXT_DB *db, int idx)
     }
 }
 
-unsigned long Ssl::CertificateDb::index_serial_hash(const char **a)
-{
+unsigned long Ssl::CertificateDb::index_serial_hash(const char **a) {
     const char *n = a[Ssl::CertificateDb::cnlSerial];
     while (*n == '0')
         ++n;
     return lh_strhash(n);
 }
 
-int Ssl::CertificateDb::index_serial_cmp(const char **a, const char **b)
-{
+int Ssl::CertificateDb::index_serial_cmp(const char **a, const char **b) {
     const char *aa, *bb;
     for (aa = a[Ssl::CertificateDb::cnlSerial]; *aa == '0'; ++aa);
     for (bb = b[Ssl::CertificateDb::cnlSerial]; *bb == '0'; ++bb);
     return strcmp(aa, bb);
 }
 
-unsigned long Ssl::CertificateDb::index_name_hash(const char **a)
-{
+unsigned long Ssl::CertificateDb::index_name_hash(const char **a) {
     return(lh_strhash(a[Ssl::CertificateDb::cnlName]));
 }
 
-int Ssl::CertificateDb::index_name_cmp(const char **a, const char **b)
-{
+int Ssl::CertificateDb::index_name_cmp(const char **a, const char **b) {
     return(strcmp(a[Ssl::CertificateDb::cnlName], b[CertificateDb::cnlName]));
 }
 
@@ -252,23 +247,20 @@ Ssl::CertificateDb::CertificateDb(std::string const & aDb_path, size_t aMax_db_s
         max_db_size(aMax_db_size),
         fs_block_size(aFs_block_size),
         dbLock(db_full),
-        enabled_disk_store(true)
-{
+        enabled_disk_store(true) {
     if (db_path.empty() && !max_db_size)
         enabled_disk_store = false;
     else if ((db_path.empty() && max_db_size) || (!db_path.empty() && !max_db_size))
         throw std::runtime_error("ssl_crtd is missing the required parameter. There should be -s and -M parameters together.");
 }
 
-bool Ssl::CertificateDb::find(std::string const & host_name, Ssl::X509_Pointer & cert, Ssl::EVP_PKEY_Pointer & pkey)
-{
+bool Ssl::CertificateDb::find(std::string const & host_name, Ssl::X509_Pointer & cert, Ssl::EVP_PKEY_Pointer & pkey) {
     const Locker locker(dbLock, Here);
     load();
     return pure_find(host_name, cert, pkey);
 }
 
-bool Ssl::CertificateDb::purgeCert(std::string const & key)
-{
+bool Ssl::CertificateDb::purgeCert(std::string const & key) {
     const Locker locker(dbLock, Here);
     load();
     if (!db)
@@ -281,8 +273,7 @@ bool Ssl::CertificateDb::purgeCert(std::string const & key)
     return true;
 }
 
-bool Ssl::CertificateDb::addCertAndPrivateKey(Ssl::X509_Pointer & cert, Ssl::EVP_PKEY_Pointer & pkey, std::string const & useName)
-{
+bool Ssl::CertificateDb::addCertAndPrivateKey(Ssl::X509_Pointer & cert, Ssl::EVP_PKEY_Pointer & pkey, std::string const & useName) {
     const Locker locker(dbLock, Here);
     load();
     if (!db || !cert || !pkey)
@@ -367,8 +358,7 @@ bool Ssl::CertificateDb::addCertAndPrivateKey(Ssl::X509_Pointer & cert, Ssl::EVP
     return true;
 }
 
-void Ssl::CertificateDb::create(std::string const & db_path)
-{
+void Ssl::CertificateDb::create(std::string const & db_path) {
     if (db_path == "")
         throw std::runtime_error("Path to db is empty");
     std::string db_full(db_path + "/" + db_file);
@@ -391,14 +381,12 @@ void Ssl::CertificateDb::create(std::string const & db_path)
         throw std::runtime_error("Cannot open " + db_full + " to open");
 }
 
-void Ssl::CertificateDb::check(std::string const & db_path, size_t max_db_size)
-{
+void Ssl::CertificateDb::check(std::string const & db_path, size_t max_db_size) {
     CertificateDb db(db_path, max_db_size, 0);
     db.load();
 }
 
-bool Ssl::CertificateDb::pure_find(std::string const & host_name, Ssl::X509_Pointer & cert, Ssl::EVP_PKEY_Pointer & pkey)
-{
+bool Ssl::CertificateDb::pure_find(std::string const & host_name, Ssl::X509_Pointer & cert, Ssl::EVP_PKEY_Pointer & pkey) {
     if (!db)
         return false;
 
@@ -420,23 +408,19 @@ bool Ssl::CertificateDb::pure_find(std::string const & host_name, Ssl::X509_Poin
     return true;
 }
 
-size_t Ssl::CertificateDb::size() const
-{
+size_t Ssl::CertificateDb::size() const {
     return readSize();
 }
 
-void Ssl::CertificateDb::addSize(std::string const & filename)
-{
+void Ssl::CertificateDb::addSize(std::string const & filename) {
     writeSize(readSize() + getFileSize(filename));
 }
 
-void Ssl::CertificateDb::subSize(std::string const & filename)
-{
+void Ssl::CertificateDb::subSize(std::string const & filename) {
     writeSize(readSize() - getFileSize(filename));
 }
 
-size_t Ssl::CertificateDb::readSize() const
-{
+size_t Ssl::CertificateDb::readSize() const {
     std::ifstream ifstr(size_full.c_str());
     if (!ifstr && enabled_disk_store)
         throw std::runtime_error("cannot open for reading: " + size_full);
@@ -446,24 +430,21 @@ size_t Ssl::CertificateDb::readSize() const
     return db_size;
 }
 
-void Ssl::CertificateDb::writeSize(size_t db_size)
-{
+void Ssl::CertificateDb::writeSize(size_t db_size) {
     std::ofstream ofstr(size_full.c_str());
     if (!ofstr && enabled_disk_store)
         throw std::runtime_error("cannot write \"" + size_full + "\" file");
     ofstr << db_size;
 }
 
-size_t Ssl::CertificateDb::getFileSize(std::string const & filename)
-{
+size_t Ssl::CertificateDb::getFileSize(std::string const & filename) {
     std::ifstream file(filename.c_str(), std::ios::binary);
     file.seekg(0, std::ios_base::end);
     size_t file_size = file.tellg();
     return ((file_size + fs_block_size - 1) / fs_block_size) * fs_block_size;
 }
 
-void Ssl::CertificateDb::load()
-{
+void Ssl::CertificateDb::load() {
     // Load db from file.
     Ssl::BIO_Pointer in(BIO_new(BIO_s_file()));
     if (!in || BIO_read_filename(in.get(), db_full.c_str()) <= 0)
@@ -487,8 +468,7 @@ void Ssl::CertificateDb::load()
     db.reset(temp_db.release());
 }
 
-void Ssl::CertificateDb::save()
-{
+void Ssl::CertificateDb::save() {
     if (!db)
         throw std::runtime_error("The certificates database is not loaded");;
 
@@ -502,8 +482,7 @@ void Ssl::CertificateDb::save()
 }
 
 // Normally defined in defines.h file
-void Ssl::CertificateDb::deleteRow(const char **row, int rowIndex)
-{
+void Ssl::CertificateDb::deleteRow(const char **row, int rowIndex) {
     const std::string filename(cert_full + "/" + row[cnlSerial] + ".pem");
     sq_TXT_DB_delete_row(db.get(), rowIndex);
 
@@ -513,8 +492,7 @@ void Ssl::CertificateDb::deleteRow(const char **row, int rowIndex)
         throw std::runtime_error("Failed to remove certficate file " + filename + " from db");
 }
 
-bool Ssl::CertificateDb::deleteInvalidCertificate()
-{
+bool Ssl::CertificateDb::deleteInvalidCertificate() {
     if (!db)
         return false;
 
@@ -543,8 +521,7 @@ bool Ssl::CertificateDb::deleteInvalidCertificate()
     return true;
 }
 
-bool Ssl::CertificateDb::deleteOldestCertificate()
-{
+bool Ssl::CertificateDb::deleteOldestCertificate() {
     if (!db)
         return false;
 
@@ -570,8 +547,7 @@ bool Ssl::CertificateDb::deleteOldestCertificate()
     return true;
 }
 
-bool Ssl::CertificateDb::deleteByHostname(std::string const & host)
-{
+bool Ssl::CertificateDb::deleteByHostname(std::string const & host) {
     if (!db)
         return false;
 
@@ -594,7 +570,6 @@ bool Ssl::CertificateDb::deleteByHostname(std::string const & host)
     return false;
 }
 
-bool Ssl::CertificateDb::IsEnabledDiskStore() const
-{
+bool Ssl::CertificateDb::IsEnabledDiskStore() const {
     return enabled_disk_store;
 }