From c81c2ea83d41670b37084e3924f7a5001fdcf1a1 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Mon, 19 Sep 2011 14:22:30 +0000 Subject: [PATCH] webserver=no would still bind the port. Found by Xander Soldaat, thanks! git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2269 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- pdns/ws.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pdns/ws.cc b/pdns/ws.cc index f52047e99..3ddbbb8f4 100644 --- a/pdns/ws.cc +++ b/pdns/ws.cc @@ -30,14 +30,19 @@ StatWebServer::StatWebServer() { d_start=time(0); d_min10=d_min5=d_min1=0; - d_ws = new WebServer(arg()["webserver-address"], arg().asNum("webserver-port"),arg()["webserver-password"]); + d_ws = 0; + if(arg().mustDo("webserver")) + d_ws = new WebServer(arg()["webserver-address"], arg().asNum("webserver-port"),arg()["webserver-password"]); } void StatWebServer::go() { - S.doRings(); - pthread_create(&d_tid, 0, threadHelper, this); - pthread_create(&d_tid, 0, statThreadHelper, this); + if(arg().mustDo("webserver")) + { + S.doRings(); + pthread_create(&d_tid, 0, threadHelper, this); + pthread_create(&d_tid, 0, statThreadHelper, this); + } } void StatWebServer::statThread() -- 2.49.0