httpgateway: set new max payload length config value

这个提交包含在:
2019-05-04 00:02:17 +02:00
父节点 f7b8001546
当前提交 d02e8d0dce
共有 4 个文件被更改,包括 23 次插入1 次删除

查看文件

@@ -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()
@@ -91,7 +93,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;

查看文件

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