Begin removing several dependencies on Config object
This commit is contained in:
@@ -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()
|
||||
|
Fai riferimento in un nuovo problema
Block a user