@@ -1,7 +1,7 @@
Index: modules/gmysqlbackend/gmysqlbackend.cc
===================================================================
---- modules/gmysqlbackend/gmysqlbackend.cc (.../Original%20sources.) (revision 13)
-+++ modules/gmysqlbackend/gmysqlbackend.cc (.../withAXFRpatch) (revision 13)
+--- modules/gmysqlbackend/gmysqlbackend.cc (.../trunk) (revision 25)
++++ modules/gmysqlbackend/gmysqlbackend.cc (.../branches/axfr-slavedb) (revision 25)
@@ -35,6 +35,24 @@
throw AhuException("Unable to launch "+mode+" connection: "+e.txtReason());
}
@@ -9,7 +9,7 @@
+
+ if(!getArg("slave-socket").empty() || !getArg("slave-host").empty()) {
+ try {
-+ setDBSlave(new SMySQL(getArg("slave-dbname"),
++ setDBReadonly(new SMySQL(getArg("slave-dbname"),
+ getArg("slave-host"),
+ getArgAsNum("slave-port"),
+ getArg("slave-socket"),
@@ -48,11 +48,26 @@
+ declare(suffix,"lookup-axfr-allow","", "select zone_grants from domains where name='%s'");
}
-
+
+Index: debian-pdns/rules
+===================================================================
+--- debian-pdns/rules (.../trunk) (revision 25)
++++ debian-pdns/rules (.../branches/axfr-slavedb) (revision 25)
+@@ -2,8 +2,8 @@
+
+ tmpdir := $(shell pwd)/debian-pdns/tmp
+ be_tmpdir := $(shell pwd)/debian-pdns/tmp-backend
+-backends := opendbx ldap mysql pipe gmysql gpgsql gsqlite gsqlite3
+-debs := opendbx ldap mysql pipe pgsql sqlite sqlite3
++backends := gmysql
++debs := mysql
+
+ binary-doc:
+ -make -C pdns/docs html/index.html
Index: pdns/ueberbackend.cc
===================================================================
---- pdns/ueberbackend.cc (.../Original%20sources.) (revision 13)
-+++ pdns/ueberbackend.cc (.../withAXFRpatch) (revision 13)
+--- pdns/ueberbackend.cc (.../trunk) (revision 25)
++++ pdns/ueberbackend.cc (.../branches/axfr-slavedb) (revision 25)
@@ -60,6 +60,15 @@
#define RTLD_NOW RTLD_LAZY
#endif
@@ -69,11 +84,10 @@
//! Loads a module and reports it to all UeberBackend threads
bool UeberBackend::loadmodule(const string &name)
{
-
Index: pdns/tcpreceiver.cc
===================================================================
---- pdns/tcpreceiver.cc (.../Original%20sources.) (revision 13)
-+++ pdns/tcpreceiver.cc (.../withAXFRpatch) (revision 13)
+--- pdns/tcpreceiver.cc (.../trunk) (revision 25)
++++ pdns/tcpreceiver.cc (.../branches/axfr-slavedb) (revision 25)
@@ -346,16 +346,42 @@
if(::arg().mustDo("disable-axfr"))
return false;
@@ -122,8 +136,8 @@
Index: pdns/common_startup.cc
===================================================================
---- pdns/common_startup.cc (.../Original%20sources.) (revision 13)
-+++ pdns/common_startup.cc (.../withAXFRpatch) (revision 13)
+--- pdns/common_startup.cc (.../trunk) (revision 25)
++++ pdns/common_startup.cc (.../branches/axfr-slavedb) (revision 25)
@@ -127,6 +127,9 @@
::arg().set("max-cache-entries", "Maximum number of cache entries")="1000000";
@@ -136,8 +150,8 @@
void declareStats(void)
Index: pdns/backends/gsql/gsqlbackend.cc
===================================================================
---- pdns/backends/gsql/gsqlbackend.cc (.../Original%20sources.) (revision 13)
-+++ pdns/backends/gsql/gsqlbackend.cc (.../withAXFRpatch) (revision 13)
+--- pdns/backends/gsql/gsqlbackend.cc (.../trunk) (revision 25)
++++ pdns/backends/gsql/gsqlbackend.cc (.../branches/axfr-slavedb) (revision 25)
@@ -16,10 +16,78 @@
#include "pdns/ahuexception.hh"
#include "pdns/logger.hh"
@@ -222,7 +236,7 @@
sqlEscape(domain).c_str());
try {
- d_db->doQuery(output, d_result);
-+ getDBSlave()->doQuery(output, d_result);
++ getDBReadonly()->doQuery(output, d_result);
}
catch (SSqlException &e) {
throw AhuException("GSQLBackend unable to retrieve list of master domains: "+e.txtReason());
@@ -231,7 +245,7 @@
sqlEscape(domain).c_str());
try {
- d_db->doQuery(output,d_result);
-+ getDBSlave()->doQuery(output,d_result);
++ getDBReadonly()->doQuery(output,d_result);
}
catch(SSqlException &e) {
throw AhuException("GSQLBackend unable to retrieve information about a domain: "+e.txtReason());
@@ -240,7 +254,7 @@
try {
- d_db->doQuery(output,d_result);
-+ getDBSlave()->doQuery(output,d_result);
++ getDBReadonly()->doQuery(output,d_result);
}
catch (SSqlException &e) {
throw AhuException("GSQLBackend unable to retrieve list of slave domains: "+e.txtReason());
@@ -249,11 +263,19 @@
try {
- d_db->doQuery(output,d_result);
-+ getDBSlave()->doQuery(output,d_result);
++ getDBReadonly()->doQuery(output,d_result);
}
catch(SSqlException &e) {
throw AhuException("GSQLBackend unable to retrieve list of master domains: "+e.txtReason());
-@@ -239,6 +307,7 @@
+@@ -215,6 +283,7 @@
+ {
+ setArgPrefix(mode+suffix);
+ d_db=0;
++ d_db_slave=NULL;
+ d_logprefix="["+mode+"Backend"+suffix+"] ";
+
+ d_noWildCardNoIDQuery=getArg("basic-query");
+@@ -239,6 +308,7 @@
d_UpdateLastCheckofZoneQuery=getArg("update-lastcheck-query");
d_InfoOfAllMasterDomainsQuery=getArg("info-all-master-query");
d_DeleteZoneQuery=getArg("delete-zone-query");
@@ -261,46 +283,46 @@
}
-@@ -291,7 +360,7 @@
+@@ -291,7 +361,7 @@
DLOG(L<< "Query: '" << output << "'"<<endl);
try {
- d_db->doQuery(output);
-+ getDBSlave()->doQuery(output);
++ getDBReadonly()->doQuery(output);
}
catch(SSqlException &e) {
throw AhuException(e.txtReason());
-@@ -309,7 +378,7 @@
+@@ -309,7 +379,7 @@
char output[1024];
snprintf(output,sizeof(output)-1,d_listQuery.c_str(),domain_id);
try {
- d_db->doQuery(output);
-+ getDBSlave()->doQuery(output);
++ getDBReadonly()->doQuery(output);
}
catch(SSqlException &e) {
throw AhuException("GSQLBackend list query: "+e.txtReason());
-@@ -329,7 +398,7 @@
+@@ -329,7 +399,7 @@
for(vector<DNSResourceRecord>::const_iterator i=nsset.begin();i!=nsset.end();++i) {
try {
snprintf(output,sizeof(output)-1,format.c_str(),sqlEscape(ip).c_str(),sqlEscape(i->content).c_str());
- d_db->doQuery(output, d_result);
-+ getDBSlave()->doQuery(output, d_result);
++ getDBReadonly()->doQuery(output, d_result);
}
catch (SSqlException &e) {
throw AhuException("GSQLBackend unable to search for a domain: "+e.txtReason());
-@@ -364,7 +433,7 @@
+@@ -364,7 +434,7 @@
{
// L << "GSQLBackend get() was called for "<<qtype.getName() << " record: ";
SSql::row_t row;
- if(d_db->getRow(row)) {
-+ if(getDBSlave()->getRow(row)) {
++ if(getDBReadonly()->getRow(row)) {
r.content=row[0];
if (row[1].empty())
r.ttl = ::arg().asNum( "default-ttl" );
Index: pdns/backends/gsql/gsqlbackend.hh
===================================================================
---- pdns/backends/gsql/gsqlbackend.hh (.../Original%20sources.) (revision 13)
-+++ pdns/backends/gsql/gsqlbackend.hh (.../withAXFRpatch) (revision 13)
+--- pdns/backends/gsql/gsqlbackend.hh (.../trunk) (revision 25)
++++ pdns/backends/gsql/gsqlbackend.hh (.../branches/axfr-slavedb) (revision 25)
@@ -14,6 +14,8 @@
{
if(d_db)
@@ -314,19 +336,19 @@
d_db=db;
}
-+ void setDBSlave(SSql *db)
++ void setDBReadonly(SSql *db)
+ {
+ d_db_slave=db;
+ }
|