mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-02 03:38:03 +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
|
try
|
||||||
{
|
{
|
||||||
currentContentLength_ = std::stoull(len.c_str());
|
currentContentLength_ =
|
||||||
|
static_cast<size_t>(std::stoull(len));
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
|
@ -127,7 +127,7 @@ bool HttpResponseParser::parseResponse(MsgBuffer *buf)
|
|||||||
// LOG_INFO << "content len=" << len;
|
// LOG_INFO << "content len=" << len;
|
||||||
if (!len.empty())
|
if (!len.empty())
|
||||||
{
|
{
|
||||||
leftBodyLength_ = atoi(len.c_str());
|
leftBodyLength_ = static_cast<size_t>(std::stoull(len));
|
||||||
status_ = HttpResponseParseStatus::kExpectBody;
|
status_ = HttpResponseParseStatus::kExpectBody;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user