httpgateway: set new max payload length config value

This commit is contained in:
2019-05-04 00:02:17 +02:00
parent 8fe7e98aaa
commit 93aea9ed7b
4 changed files with 21 additions and 1 deletions

View File

@ -33,6 +33,8 @@ HttpGateway::HttpGateway(const Config &config)
throw new std::runtime_error("No http.listenport in config file");
}
this->listenport = std::stoi(listenport);
this->maxPayloadLength = config.max_payload_length;
}
bool HttpGateway::keepReading()
@ -90,7 +92,7 @@ httplib::Response HttpGateway::convertResponse(Response response)
void HttpGateway::work(RequestWorker &worker)
{
httplib::Server server;
server.set_payload_max_length(this->maxPayloadLength);
auto handler = [&](const httplib::Request &req, httplib::Response &res) {
Request wikiRequest = convertRequest(req);
Logger::debug() << "httpgateway: received request " << wikiRequest;

View File

@ -16,6 +16,7 @@ class HttpGateway : public GatewayInterface
std::string listenaddr;
int listenport;
uint64_t maxPayloadLength;
public:
HttpGateway(const Config &config);