Browse Source

[1062] some minor editorial changes, mostly just folding long lines.

JINMEI Tatuya 13 years ago
parent
commit
cfd1d9e142

+ 16 - 13
src/lib/datasrc/database.cc

@@ -179,15 +179,16 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
             try {
                 const isc::dns::RRType cur_type(columns[DatabaseConnection::TYPE_COLUMN]);
                 const isc::dns::RRTTL cur_ttl(columns[DatabaseConnection::TTL_COLUMN]);
-                // Ths sigtype column was an optimization for finding the relevant
-                // RRSIG RRs for a lookup. Currently this column is not used in this
-                // revised datasource implementation. We should either start using it
-                // again, or remove it from use completely (i.e. also remove it from
-                // the schema and the backend implementation).
-                // Note that because we don't use it now, we also won't notice it if
-                // the value is wrong (i.e. if the sigtype column contains an rrtype
-                // that is different from the actual value of the 'type covered' field
-                // in the RRSIG Rdata).
+                // Ths sigtype column was an optimization for finding the
+                // relevant RRSIG RRs for a lookup. Currently this column is
+                // not used in this revised datasource implementation. We
+                // should either start using it again, or remove it from use
+                // completely (i.e. also remove it from the schema and the
+                // backend implementation).
+                // Note that because we don't use it now, we also won't notice
+                // it if the value is wrong (i.e. if the sigtype column
+                // contains an rrtype that is different from the actual value
+                // of the 'type covered' field in the RRSIG Rdata).
                 //cur_sigtype(columns[SIGTYPE_COLUMN]);
 
                 if (cur_type == type) {
@@ -199,7 +200,8 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
                     addOrCreate(result_rrset, name, getClass(), cur_type,
                                 cur_ttl, columns[DatabaseConnection::RDATA_COLUMN]);
                 } else if (cur_type == isc::dns::RRType::CNAME()) {
-                    // There should be no other data, so result_rrset should be empty.
+                    // There should be no other data, so result_rrset should
+                    // be empty.
                     if (result_rrset) {
                         isc_throw(DataSourceError, "CNAME found but it is not "
                                   "the only record for " + name.toText());
@@ -211,9 +213,10 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
                     // If we get signatures before we get the actual data, we
                     // can't know which ones to keep and which to drop...
                     // So we keep a separate store of any signature that may be
-                    // relevant and add them to the final RRset when we are done.
-                    // A possible optimization here is to not store them for types
-                    // we are certain we don't need
+                    // relevant and add them to the final RRset when we are
+                    // done.
+                    // A possible optimization here is to not store them for
+                    // types we are certain we don't need
                     sig_store.addSig(isc::dns::rdata::createRdata(cur_type,
                                     getClass(),
                                     columns[DatabaseConnection::RDATA_COLUMN]));

+ 5 - 3
src/lib/datasrc/sqlite3_connection.cc

@@ -329,6 +329,7 @@ SQLite3Connection::searchForRecords(int zone_id, const std::string& name) {
                   "Error in sqlite3_bind_int() for zone_id " <<
                   zone_id << ", sqlite3 result code: " << result);
     }
+
     // use transient since name is a ref and may disappear
     result = sqlite3_bind_text(dbparameters_->q_any_, 2, name.c_str(), -1,
                                SQLITE_TRANSIENT);
@@ -337,7 +338,7 @@ SQLite3Connection::searchForRecords(int zone_id, const std::string& name) {
                   "Error in sqlite3_bind_text() for name " <<
                   name << ", sqlite3 result code: " << result);
     }
-};
+}
 
 namespace {
 // This helper function converts from the unsigned char* type (used by
@@ -382,8 +383,9 @@ SQLite3Connection::getNextRecord(std::string columns[], size_t column_count) {
         resetSearch();
         isc_throw(DataSourceError,
                 "Unexpected failure in sqlite3_step (sqlite result code " << rc << ")");
-    } catch (std::bad_alloc) {
-        isc_throw(DataSourceError, "bad_alloc in Sqlite3Connection::getNextRecord");
+    } catch (const std::bad_alloc&) {
+        isc_throw(DataSourceError,
+                  "bad_alloc in Sqlite3Connection::getNextRecord");
     }
     // Compilers might not realize isc_throw always throws
     return (false);

+ 1 - 1
src/lib/datasrc/tests/database_unittest.cc

@@ -51,7 +51,7 @@ public:
         search_running_ = true;
 
         // 'hardcoded' name to trigger exceptions (for testing
-        // the error handling of find() (the other on is below in 
+        // the error handling of find() (the other on is below in
         // if the name is "exceptiononsearch" it'll raise an exception here
         if (name == "dsexception.in.search.") {
             isc_throw(DataSourceError, "datasource exception on search");

+ 1 - 2
src/lib/datasrc/tests/sqlite3_connection_unittest.cc

@@ -127,8 +127,7 @@ TEST_F(SQLite3Conn, getRecords) {
     std::string columns[column_count];
 
     // without search, getNext() should return false
-    EXPECT_FALSE(conn->getNextRecord(columns,
-        column_count));
+    EXPECT_FALSE(conn->getNextRecord(columns, column_count));
     checkRecordRow(columns, "", "", "", "");
 
     conn->searchForRecords(zone_id, "foo.bar.");