(http server) read body request when the Content-Length is specified + set timeout to read the request to 30 seconds max by default, and make it configurable as a constructor parameter

This commit is contained in:
Benjamin Sergeant
2020-09-12 14:17:06 -07:00
parent b04e5c5529
commit 128bc0afa9
6 changed files with 21 additions and 9 deletions

View File

@ -118,7 +118,7 @@ namespace ix
{
public:
static std::tuple<bool, std::string, HttpRequestPtr> parseRequest(
std::unique_ptr<Socket>& socket);
std::unique_ptr<Socket>& socket, int timeoutSecs);
static bool sendResponse(HttpResponsePtr response, std::unique_ptr<Socket>& socket);
static std::pair<std::string, int> parseStatusLine(const std::string& line);