Begin removing several dependencies on Config object

这个提交包含在:
2019-09-29 17:12:36 +02:00
父节点 327c0793d1
当前提交 364d82a99f
共有 9 个文件被更改,包括 127 次插入79 次删除

查看文件

@@ -20,21 +20,11 @@ SOFTWARE.
*/
#include "httpgateway.h"
#include "../logger.h"
HttpGateway::HttpGateway(const Config &config)
HttpGateway::HttpGateway(std::string listenaddr, int port, uint64_t maxPayloadLength)
{
this->listenaddr = config.getConfig("http.listenaddr");
if(this->listenaddr.empty())
{
throw new std::runtime_error("No http.listenaddr in config file");
}
std::string listenport = config.getConfig("http.listenport");
if(listenport.empty())
{
throw new std::runtime_error("No http.listenport in config file");
}
this->listenport = std::stoi(listenport);
this->maxPayloadLength = config.max_payload_length;
this->listenaddr = listenaddr;
this->listenport = port;
this->maxPayloadLength = maxPayloadLength;
}
bool HttpGateway::keepReading()