../../pdns/dnsrecords.cc \
../../pdns/dnssecinfra.cc \
../../pdns/ednssubnet.cc \
- ../../pdns/json.hh ../../pdns/json.cc \
../../pdns/logger.cc \
../../pdns/misc.cc \
../../pdns/nsecrecords.cc \
#include <fcntl.h>
#include <sstream>
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/writer.h"
+#include <rapidjson/stringbuffer.h>
+#include <rapidjson/writer.h>
#include "pdns/lock.hh"
#ifndef UNIX_PATH_MAX
req.headers["accept"] = "application/json";
}
-
void HTTPConnector::post_requestbuilder(const rapidjson::Document &input, YaHTTP::Request& req) {
+ rapidjson::StringBuffer output;
+ rapidjson::Writer<rapidjson::StringBuffer> w(output);
if (this->d_post_json) {
req.setup("POST", d_url);
// simple case, POST JSON into url. nothing fancy.
- std::string out = makeStringFromDocument(input);
+ input.Accept(w);
+ std::string out(output.GetString(), output.Size());
req.headers["Content-Type"] = "text/javascript; charset=utf-8";
req.headers["Content-Length"] = std::to_string(out.size());
req.headers["accept"] = "application/json";
} else {
std::stringstream url,content;
// call url/method.suffix
- rapidjson::StringBuffer output;
- rapidjson::Writer<rapidjson::StringBuffer> w(output);
input["parameters"].Accept(w);
url << d_url << "/" << input["method"].GetString() << d_url_suffix;
req.setup("POST", url.str());
#endif
#include <sys/types.h>
#include <sys/wait.h>
+#include <sstream>
+#include <rapidjson/stringbuffer.h>
+#include <rapidjson/writer.h>
#include "remotebackend.hh"
PipeConnector::PipeConnector(std::map<std::string,std::string> options) {
int PipeConnector::send_message(const rapidjson::Document &input)
{
- std::string line;
- line = makeStringFromDocument(input);
+ rapidjson::StringBuffer output;
+ rapidjson::Writer<rapidjson::StringBuffer> w(output);
+ input.Accept(w);
+ auto line = std::string(output.GetString(), output.Size());
launch();
line.append(1,'\n');
#include "pdns/dns.hh"
#include "pdns/dnsbackend.hh"
#include "pdns/dnspacket.hh"
-#include "pdns/json.hh"
#include "pdns/logger.hh"
#include "pdns/namespaces.hh"
#include "pdns/pdnsexception.hh"
#include "pdns/arguments.hh"
#include <rapidjson/rapidjson.h>
#include <rapidjson/document.h>
-#include "pdns/json.hh"
#include "pdns/statbag.hh"
#include "pdns/packetcache.hh"
#include "pdns/arguments.hh"
#include <rapidjson/rapidjson.h>
#include <rapidjson/document.h>
-#include "pdns/json.hh"
#include "pdns/statbag.hh"
#include "pdns/packetcache.hh"
#include "pdns/dnsrecords.hh"
#include <rapidjson/rapidjson.h>
#include <rapidjson/document.h>
-#include "pdns/json.hh"
#include "pdns/statbag.hh"
#include "pdns/packetcache.hh"
#include "pdns/arguments.hh"
#include <rapidjson/rapidjson.h>
#include <rapidjson/document.h>
-#include "pdns/json.hh"
#include "pdns/statbag.hh"
#include "pdns/packetcache.hh"
#include "pdns/dnsrecords.hh"
#include <rapidjson/rapidjson.h>
#include <rapidjson/document.h>
-#include "pdns/json.hh"
#include "pdns/statbag.hh"
#include "pdns/packetcache.hh"
#include "pdns/dnsrecords.hh"
#include <rapidjson/rapidjson.h>
#include <rapidjson/document.h>
-#include "pdns/json.hh"
#include "pdns/statbag.hh"
#include "pdns/packetcache.hh"
#include "pdns/arguments.hh"
#include <rapidjson/rapidjson.h>
#include <rapidjson/document.h>
-#include "pdns/json.hh"
#include "pdns/statbag.hh"
#include "pdns/packetcache.hh"
#endif
#include "remotebackend.hh"
#include <sys/socket.h>
+#include <sstream>
+#include <rapidjson/stringbuffer.h>
+#include <rapidjson/writer.h>
#include "pdns/lock.hh"
#include <unistd.h>
#include <fcntl.h>
}
int UnixsocketConnector::send_message(const rapidjson::Document &input) {
- std::string data;
- int rv;
- data = makeStringFromDocument(input);
- data = data + "\n";
- rv = this->write(data);
+ rapidjson::StringBuffer output;
+ rapidjson::Writer<rapidjson::StringBuffer> w(output);
+ input.Accept(w);
+ auto data = std::string(output.GetString(), output.Size()) + "\n";
+ int rv = this->write(data);
if (rv == -1)
return -1;
return rv;
#include <fcntl.h>
#include <sstream>
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/writer.h"
+#include <rapidjson/stringbuffer.h>
+#include <rapidjson/writer.h>
ZeroMQConnector::ZeroMQConnector(std::map<std::string,std::string> options) {
rapidjson::Value val;
};
int ZeroMQConnector::send_message(const rapidjson::Document &input) {
- std::string line;
- line = makeStringFromDocument(input);
+ rapidjson::StringBuffer output;
+ rapidjson::Writer<rapidjson::StringBuffer> w(output);
+ input.Accept(w);
+ auto line = std::string(output.GetString(), output.Size());
zmq_msg_t message;
zmq_msg_init_size(&message, line.size()+1);