Only Consume() after a full request is processed

This commit is contained in:
flamingcow
2019-05-09 19:19:26 -07:00
parent 1cba4ac1ae
commit 67f0fc48f9
7 changed files with 12 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ namespace firecgi {
class Server {
public:
Server(int port, const std::function<void(Request*)>& callback, int threads=1, const std::unordered_set<std::string_view>& headers={});
Server(int port, const std::function<void(Request*)>& callback, int threads=1, const std::unordered_set<std::string_view>& headers={}, int max_request_len=(16*1024));
void Serve();
private:
@@ -22,6 +22,7 @@ class Server {
const std::function<void(Request*)> callback_;
const int threads_;
const std::unordered_set<std::string_view> headers_;
const int max_request_len_;
};
} // firecgi