]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
REST API: take config-name into account in search-log 1297/head
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Mon, 24 Feb 2014 12:54:59 +0000 (13:54 +0100)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Mon, 24 Feb 2014 12:54:59 +0000 (13:54 +0100)
pdns/ws-api.cc

index d47dd1e6d604156c34fdbc6912190d14cec9f150..7fe9590735184ebfb209a15da28dd9053ccecf03 100644 (file)
@@ -33,6 +33,8 @@
 #include <sys/types.h>
 #include <iomanip>
 
+extern string s_programname;
+
 #ifndef HAVE_STRCASESTR
 
 /*
@@ -185,15 +187,7 @@ void apiServerSearchLog(HttpRequest* req, HttpResponse* resp) {
   if(req->method != "GET")
     throw HttpMethodNotAllowedException();
 
-  string prefix;
-  switch (versionGetProduct()) {
-  case ProductAuthoritative:
-    prefix = " pdns[";
-    break;
-  case ProductRecursor:
-    prefix = " pdns_recursor[";
-    break;
-  }
+  string prefix = " " + s_programname + "[";
   resp->body = logGrep(req->parameters["q"], ::arg()["experimental-logfile"], prefix);
 }