mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-02 03:38:03 +08:00
Fix a error in HttpClient (#262)
This commit is contained in:
parent
70eda27427
commit
56b9a320b5
@ -203,6 +203,10 @@ bool HttpResponseParser::parseResponse(MsgBuffer *buf)
|
||||
}
|
||||
else if (_state == HttpResponseParseState::kExpectClose)
|
||||
{
|
||||
if (!_response->_bodyPtr)
|
||||
{
|
||||
_response->_bodyPtr = std::make_shared<std::string>();
|
||||
}
|
||||
_response->_bodyPtr->append(
|
||||
std::string(buf->peek(), buf->readableBytes()));
|
||||
buf->retrieveAll();
|
||||
@ -242,6 +246,10 @@ bool HttpResponseParser::parseResponse(MsgBuffer *buf)
|
||||
if (*(buf->peek() + _response->_currentChunkLength) == '\r' &&
|
||||
*(buf->peek() + _response->_currentChunkLength + 1) == '\n')
|
||||
{
|
||||
if (!_response->_bodyPtr)
|
||||
{
|
||||
_response->_bodyPtr = std::make_shared<std::string>();
|
||||
}
|
||||
_response->_bodyPtr->append(
|
||||
std::string(buf->peek(),
|
||||
_response->_currentChunkLength));
|
||||
|
2
trantor
2
trantor
@ -1 +1 @@
|
||||
Subproject commit 1f4b6398e8c575341d4fbf6927d0b050d99fb05a
|
||||
Subproject commit e95f82d3090f81b4f5b7610b4e0e6e609c734509
|
Loading…
Reference in New Issue
Block a user