]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/webserver.cc
Merge pull request #8223 from PowerDNS/omoerbeek-patch-1
[thirdparty/pdns.git] / pdns / webserver.cc
index fa8df4837f9086117613c400aa79e9e911853755..1b14c1487b39df93f18f83abf3d2d01f0aee08dd 100644 (file)
@@ -352,19 +352,21 @@ void WebServer::serveConnection(std::shared_ptr<Socket> client) const {
 
   HttpRequest req(logprefix);
   HttpResponse resp;
+  resp.max_response_size=d_maxbodysize;
   ComboAddress remote;
   string reply;
 
   try {
     YaHTTP::AsyncRequestLoader yarl;
     yarl.initialize(&req);
+    req.max_request_size=d_maxbodysize;
     int timeout = 5;
     client->setNonBlocking();
 
     try {
       while(!req.complete) {
         int bytes;
-        char buf[1024];
+        char buf[16000];
         bytes = client->readWithTimeout(buf, sizeof(buf), timeout);
         if (bytes > 0) {
           string data = string(buf, bytes);
@@ -414,7 +416,8 @@ void WebServer::serveConnection(std::shared_ptr<Socket> client) const {
 WebServer::WebServer(const string &listenaddress, int port) :
   d_listenaddress(listenaddress),
   d_port(port),
-  d_server(nullptr)
+  d_server(nullptr),
+  d_maxbodysize(2*1024*1024)
 {
 }