httpgateway: set new max payload length config value

这个提交包含在:
2019-05-04 00:02:17 +02:00
父节点 8fe7e98aaa
当前提交 93aea9ed7b
共有 4 个文件被更改,包括 21 次插入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()
@@ -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;

查看文件

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