From: Christian Hofstaedtler Date: Fri, 4 Dec 2015 20:27:36 +0000 (+0100) Subject: API: Reenable Recursor tests X-Git-Tag: dnsdist-1.0.0-alpha1~86^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fa5806e7f9b2dd21be8d4470b56ac94a6e5bf61;p=pdns API: Reenable Recursor tests And fix a memory/rapidjson issue. If the data is correct is yet to be seen. --- diff --git a/.travis.yml b/.travis.yml index 7f95975b7..08927f045 100644 --- a/.travis.yml +++ b/.travis.yml @@ -293,7 +293,7 @@ script: ### api ### - cd regression-tests.api - ./runtests authoritative - #DNSName: - ./runtests recursor + - ./runtests recursor - cd .. diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index 978e9da1b..41f085682 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -149,8 +149,8 @@ static void fillZone(const DNSName& zonename, HttpResponse* resp) string url = "/api/v1/servers/localhost/zones/" + zoneId; Value jurl(url.c_str(), doc.GetAllocator()); // copy doc.AddMember("url", jurl, doc.GetAllocator()); - Value jname(iter->first.toString().c_str(), doc.GetAllocator()); // copy - doc.AddMember("name", jname, doc.GetAllocator()); + Value jzonename(iter->first.toString().c_str(), doc.GetAllocator()); // copy + doc.AddMember("name", jzonename, doc.GetAllocator()); doc.AddMember("kind", zone.d_servers.empty() ? "Native" : "Forwarded", doc.GetAllocator()); Value servers; servers.SetArray(); @@ -309,7 +309,8 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) string url = "/api/v1/servers/localhost/zones/" + zoneId; Value jurl(url.c_str(), doc.GetAllocator()); // copy jdi.AddMember("url", jurl, doc.GetAllocator()); - jdi.AddMember("name", val.first.toString().c_str(), doc.GetAllocator()); + Value jzonename(val.first.toString().c_str(), doc.GetAllocator()); // copy + jdi.AddMember("name", jzonename, doc.GetAllocator()); jdi.AddMember("kind", zone.d_servers.empty() ? "Native" : "Forwarded", doc.GetAllocator()); Value servers; servers.SetArray();