httpgateway: set new max payload length config value

Šī revīzija ir iekļauta:
2019-05-04 00:02:17 +02:00
vecāks 8fe7e98aaa
revīzija 93aea9ed7b
4 mainīti faili ar 21 papildinājumiem un 1 dzēšanām

Parādīt failu

@@ -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;

Parādīt failu

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