From: Pieter Lexis Date: Mon, 21 Jan 2019 16:57:43 +0000 (+0100) Subject: webserver: create a UUID per request X-Git-Tag: dnsdist-1.4.0-alpha1~39^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f9a800209eec21399366db8394160897d1c0b0e;p=thirdparty%2Fpdns.git webserver: create a UUID per request --- diff --git a/configure.ac b/configure.ac index 259604bbd1..daafed2310 100644 --- a/configure.ac +++ b/configure.ac @@ -106,7 +106,7 @@ PDNS_CHECK_LIBCRYPTO_EDDSA PDNS_CHECK_RAGEL([pdns/dnslabeltext.cc], [www.powerdns.com]) PDNS_CHECK_CLOCK_GETTIME -BOOST_REQUIRE([1.35]) +BOOST_REQUIRE([1.42]) # Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+ # to be compatible with C++11 AM_CONDITIONAL([HAVE_BOOST_GE_148], [test "$boost_major_version" -ge 148]) diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 36f1877c97..099c84868c 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -223,6 +223,7 @@ pdns_server_SOURCES = \ tsigutils.hh tsigutils.cc \ tkey.cc \ ueberbackend.cc ueberbackend.hh \ + uuid-utils.hh uuid-utils.cc \ unix_semaphore.cc \ unix_utility.cc \ utility.hh \ @@ -639,6 +640,7 @@ ixfrdist_SOURCES = \ statbag.cc \ threadname.hh threadname.cc \ tsigverifier.cc tsigverifier.hh \ + uuid-utils.hh uuid-utils.cc \ unix_utility.cc \ webserver.hh webserver.cc \ zoneparser-tng.cc diff --git a/pdns/webserver.cc b/pdns/webserver.cc index e7a3521eea..740922a078 100644 --- a/pdns/webserver.cc +++ b/pdns/webserver.cc @@ -33,6 +33,7 @@ #include "dns.hh" #include "base64.hh" #include "json.hh" +#include "uuid-utils.hh" #include json11::Json HttpRequest::json() @@ -278,7 +279,7 @@ void WebServer::handleRequest(HttpRequest& req, HttpResponse& resp) const } void WebServer::serveConnection(std::shared_ptr client) const { - const string logprefix = d_logprefix + "<" + "I should be a UUID" + "> "; + const string logprefix = d_logprefix + "<" + to_string(getUniqueID()) + "> "; HttpRequest req(logprefix); HttpResponse resp;