Begin removing several dependencies on Config object

此提交包含在:
2019-09-29 17:12:36 +02:00
父節點 327c0793d1
當前提交 364d82a99f
共有 9 個檔案被更改,包括 127 行新增79 行删除

查看文件

@@ -24,5 +24,16 @@ SOFTWARE.
std::unique_ptr<GatewayInterface> createGateway(const Config &c)
{
return std::make_unique<HttpGateway>(c);
std::string listenaddr = c.configVarResolver.getConfig("http.listenaddr");
if(listenaddr.empty())
{
throw new std::runtime_error("No http.listenaddr in config file");
}
std::string listenport = c.configVarResolver.getConfig("http.listenport");
if(listenport.empty())
{
throw new std::runtime_error("No http.listenport in config file");
}
return std::make_unique<HttpGateway>(listenaddr, std::stoi(listenport), c.max_payload_length);
}