mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-30 02:37:57 +08:00
Fix a bug when converting the content-length string to size_t (#1355)
This commit is contained in:
parent
64b9484657
commit
f582a16adb
@ -216,7 +216,8 @@ bool HttpRequestParser::parseRequest(MsgBuffer *buf)
|
||||
{
|
||||
try
|
||||
{
|
||||
currentContentLength_ = std::stoull(len.c_str());
|
||||
currentContentLength_ =
|
||||
static_cast<size_t>(std::stoull(len));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ bool HttpResponseParser::parseResponse(MsgBuffer *buf)
|
||||
// LOG_INFO << "content len=" << len;
|
||||
if (!len.empty())
|
||||
{
|
||||
leftBodyLength_ = atoi(len.c_str());
|
||||
leftBodyLength_ = static_cast<size_t>(std::stoull(len));
|
||||
status_ = HttpResponseParseStatus::kExpectBody;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user