[svn] commit: r770 - /branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Feb 9 11:48:21 UTC 2010


Author: mgraff
Date: Tue Feb  9 11:48:21 2010
New Revision: 770

Log:
debugging fixes, thanks Shane

Modified:
    branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.cc

Modified: branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.cc
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.cc (original)
+++ branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.cc Tue Feb  9 11:48:21 2010
@@ -66,13 +66,18 @@
 
 int Sqlite3DataSrc::findRecords(const Name& name, const RRType& rdtype, RRsetList& target) const {
     int rc;
-    const char *c_name = name.toText().c_str();
-    const char *c_rdtype = rdtype.toText().c_str();
+    const string s_name = name.toText();
+    const char *c_name = s_name.c_str();
+    const string s_rdtype = rdtype.toText();
+    const char *c_rdtype = s_rdtype.c_str();
     
     int zone_id = findClosest(c_name, NULL);
     if (zone_id < 0) {
         return (0);
     }
+    
+    RRsetPtr rrset = RRsetPtr(new RRset(name, RRClass("IN"), rdtype,
+                                        RRTTL(3600)));
 
     sqlite3_reset(q_record);
     sqlite3_clear_bindings(q_record);
@@ -90,12 +95,9 @@
         throw("Could not bind 3");
     }
 
-    RRsetPtr rrset = RRsetPtr(new RRset(name, RRClass("IN"), rdtype,
-                                        RRTTL(3600)));
+    // loop
     int target_ttl = -1;
     int sig_ttl = -1;
-
-    // loop
     int rows = 0;
     rc = sqlite3_step(q_record);
     while (rc == SQLITE_ROW) {
@@ -152,7 +154,7 @@
             current++;
         }
         if (*current == '.') {
-            *current++;
+            current++;
         }
     }
 
@@ -237,6 +239,8 @@
 {
     db = NULL;
     database_version = -1;
+    q_zone = NULL;
+    q_record = NULL;
 }
 
 Sqlite3DataSrc::~Sqlite3DataSrc()
@@ -261,10 +265,11 @@
 void
 Sqlite3DataSrc::findClosestEnclosure(NameMatch& match) const {
     const Name& qname = match.qname();
-
-    const char *position;
-    
-    int ret = findClosest(qname.toText().c_str(), &position);
+    const string target_string = qname.toText();
+
+    const char *position = NULL;
+    
+    int ret = findClosest(target_string.c_str(), &position);
     if (ret == -1) {
         return;
     }




More information about the bind10-changes mailing list