From 2dfd6b650cf5af6bd419ab208f1f60ea626ecbe1 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Wed, 23 Apr 2014 09:09:26 +0200 Subject: [PATCH] Revert "appears to do something" This reverts commit a2e9e5a5891f74ce4f15fa79395085915f449340. --- pdns/Makefile.am | 2 +- pdns/zone2sql.cc | 46 +++++++++--------------------------------- pdns/zoneparser-tng.cc | 12 ++++------- pdns/zoneparser-tng.hh | 5 ++--- 4 files changed, 17 insertions(+), 48 deletions(-) diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 0bf2fd040..5acc3b6f2 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -113,7 +113,7 @@ zone2sql_SOURCES=bindparser.yy bindlexer.l bind-dnssec.schema.sqlite3.sql.h \ zoneparser-tng.cc dnsrecords.cc sillyrecords.cc \ dnswriter.cc dnslabeltext.cc rcpgenerator.cc dnsparser.cc base64.cc \ nsecrecords.cc dnssecinfra.cc base32.cc bindparserclasses.hh \ - dns_random.cc json.cc json.hh + dns_random.cc zone2sql_LDFLAGS=@THREADFLAGS@ zone2sql_LDADD= $(POLARSSL_LIBS) diff --git a/pdns/zone2sql.cc b/pdns/zone2sql.cc index 15d183210..250c31ec0 100644 --- a/pdns/zone2sql.cc +++ b/pdns/zone2sql.cc @@ -1,6 +1,6 @@ /* PowerDNS Versatile Database Driven Nameserver - Copyright (C) 2002 - 2014 PowerDNS.COM BV + Copyright (C) 2002 - 2011 PowerDNS.COM BV This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 @@ -24,7 +24,7 @@ #include #include #include -#include "json.hh" + #include #include #include "namespaces.hh" @@ -142,23 +142,8 @@ static void emitDomain(const string& domain, const vector *masters = 0) } } -static void emitRecord(const string& zoneName, const string &qname, const string &qtype, const string &ocontent, int ttl, int prio, const string& comment="") +static void emitRecord(const string& zoneName, const string &qname, const string &qtype, const string &ocontent, int ttl, int prio) { - int disabled=0; - string recordcomment; - - if(!comment.empty()) { - string::size_type pos = comment.find("json={"); - if(pos!=string::npos) { - string json = comment.substr(pos+5); - rapidjson::Document document; - if(document.Parse<0>(json.c_str()).HasParseError()) - throw runtime_error("Could not parse JSON '"+json+"'"); - - disabled=boolFromJson(document, "disabled", false); - recordcomment=stringFromJson(document, "comment", ""); - } - } g_numRecords++; string content(ocontent); @@ -184,22 +169,15 @@ static void emitRecord(const string& zoneName, const string &qname, const string cout<<"insert into records (domain_id, name, type,content,ttl,prio,disabled) select id ,"<< sqlstr(toLower(stripDot(qname)))<<", "<< sqlstr(qtype)<<", "<< - sqlstr(stripDotContent(content))<<", "<clear(); - if(comment && d_line.find(';') != string::npos) - *comment = d_line.substr(d_line.find(';')); + parts_t parts; vstringtok(parts, d_line); @@ -317,9 +314,8 @@ bool ZoneParserTNG::get(DNSResourceRecord& rr, std::string* comment) if(nextpart.empty()) break; - if(nextpart.find(';')!=string::npos) { + if(nextpart.find(';')!=string::npos) break; - } // cout<<"Next part: '"< > parts_t; private: @@ -54,7 +54,6 @@ private: uint32_t d_templatecounter, d_templatestop, d_templatestep; string d_templateline; parts_t d_templateparts; - bool d_doPassComments; struct filestate { filestate(FILE* fp, string filename) : d_fp(fp), d_filename(filename), d_lineno(0){} -- 2.40.0