From: Christian Hofstaedtler Date: Wed, 21 Aug 2013 16:12:31 +0000 (+0200) Subject: fill in notified_serial and serial in gsql getDomainInfo X-Git-Tag: rec-3.6.0-rc1~509^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85b8554f3e2a057e83192752356fc2011b06d60d;p=thirdparty%2Fpdns.git fill in notified_serial and serial in gsql getDomainInfo Filling in notified_serial is free; the query already fetches notified_serial, but we didn't copy it over. We now also always try the SOA lookup to get the domain serial, which previously only happened in the SLAVE case. This might provoke a few more notices/errors, but not really for sane database contents. --- diff --git a/pdns/backends/gsql/gsqlbackend.cc b/pdns/backends/gsql/gsqlbackend.cc index 0dc190d364..57c0f071f2 100644 --- a/pdns/backends/gsql/gsqlbackend.cc +++ b/pdns/backends/gsql/gsqlbackend.cc @@ -107,8 +107,8 @@ bool GSQLBackend::isMaster(const string &domain, const string &ip) bool GSQLBackend::getDomainInfo(const string &domain, DomainInfo &di) { - /* list all domains that need refreshing for which we are slave, and insert into SlaveDomain: - id,name,master IP,serial */ + /* fill DomainInfo from database info: + id,name,master IP(s),last_check,notified_serial,type */ char output[1024]; snprintf(output,sizeof(output)-1,d_InfoOfDomainsZoneQuery.c_str(), sqlEscape(domain).c_str()); @@ -127,29 +127,29 @@ bool GSQLBackend::getDomainInfo(const string &domain, DomainInfo &di) di.zone=d_result[0][1]; stringtok(di.masters, d_result[0][2], " ,\t"); di.last_check=atol(d_result[0][3].c_str()); + di.notified_serial = atol(d_result[0][4].c_str()); di.backend=this; - + + di.serial = 0; + try { + SOAData sd; + if(!getSOA(domain,sd)) + L<