From: Christian Hofstaedtler Date: Wed, 4 Sep 2013 09:59:28 +0000 (+0200) Subject: json: Remove old get-zone implementations X-Git-Tag: rec-3.6.0-rc1~462^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2be1beb3683678f540904cc173cc0db23c12a394;p=pdns json: Remove old get-zone implementations pdnscontrol users must upgrade to at least 4c0e059731. --- diff --git a/pdns/json_ws.cc b/pdns/json_ws.cc index 30567a444..d63c64167 100644 --- a/pdns/json_ws.cc +++ b/pdns/json_ws.cc @@ -160,27 +160,6 @@ string JWebserver::handleRequest(const string &method, const string &uri, const } content += makeStringFromDocument(doc); } - else if(command == "get-zone") { - SyncRes::domainmap_t::const_iterator ret = t_sstorage->domainmap->find(varmap["zone"]); - - content += "["; - bool first=1; - - if(ret != t_sstorage->domainmap->end()) { - BOOST_FOREACH(const SyncRes::AuthDomain::records_t::value_type& val, ret->second.d_records) { - if(!first) content+= ", "; - first=false; - stats.clear(); - stats["name"] = val.qname; - stats["type"] = val.qtype.getName(); - stats["ttl"] = lexical_cast(val.ttl); - stats["priority"] = lexical_cast(val.priority); - stats["content"] = val.content; - content += returnJSONObject(stats); - } - } - content += "]"; - } else if(command == "zone") { SyncRes::domainmap_t::const_iterator ret = t_sstorage->domainmap->find(varmap["zone"]); if (ret != t_sstorage->domainmap->end()) { diff --git a/pdns/ws.cc b/pdns/ws.cc index 9ead25483..20cfd73ca 100644 --- a/pdns/ws.cc +++ b/pdns/ws.cc @@ -324,36 +324,6 @@ static string json_dispatch(const string& method, const string& post, varmap_t& //cerr<<"Flushed cache for '"< err; - err["error"] = "Could not find domain '"+varmap["zone"]+"'"; - return returnJSONObject(err); - } - sd.db->list(varmap["zone"], sd.domain_id); - DNSResourceRecord rr; - - string ret = "["; - map object; - bool first=1; - while(sd.db->get(rr)) { - if(!first) ret += ", "; - first=false; - object.clear(); - object["name"] = rr.qname; - object["type"] = rr.qtype.getName(); - object["ttl"] = lexical_cast(rr.ttl); - object["priority"] = lexical_cast(rr.priority); - object["content"] = rr.content; - ret+=returnJSONObject(object); - } - - ret += "]"; - return ret; - } else if(command == "pdns-control") { if(method!="POST") { map m;