string doGetStats();
IXFRDistWebServer::IXFRDistWebServer(const ComboAddress &listenAddress, const NetmaskGroup &acl) {
- // TODO wrap in smart pointer
- d_ws = new WebServer(listenAddress.toString() , listenAddress.getPort());
+ d_ws = std::unique_ptr<WebServer>(new WebServer(listenAddress.toString(), listenAddress.getPort()));
d_ws->setACL(acl);
d_ws->registerWebHandler("/metrics", boost::bind(&IXFRDistWebServer::getMetrics, this, _1, _2));
d_ws->bind();
}
}
- auto ws = IXFRDistWebServer(config["webserver-address"].as<ComboAddress>(), wsACL);
- std::thread (&IXFRDistWebServer::go, ws).detach();
+ // Launch the webserver!
+ std::thread(&IXFRDistWebServer::go, IXFRDistWebServer(config["webserver-address"].as<ComboAddress>(), wsACL)).detach();
}
int newuid = 0;