diff options
Diffstat (limited to '')
-rw-r--r-- | src/HTTP/HTTPResponseParser.cpp (renamed from src/HTTPServer/HTTPResponseParser.cpp) | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/HTTPServer/HTTPResponseParser.cpp b/src/HTTP/HTTPResponseParser.cpp index b3ce9dab6..9411208e2 100644 --- a/src/HTTPServer/HTTPResponseParser.cpp +++ b/src/HTTP/HTTPResponseParser.cpp @@ -13,6 +13,7 @@ cHTTPResponseParser::cHTTPResponseParser(cHTTPResponseParser::cCallbacks & a_Callbacks): Super(mkResponse), m_Callbacks(a_Callbacks), + m_HasHadError(false), m_IsInHeaders(true), m_IsFinished(false), m_EnvelopeParser(*this) @@ -56,7 +57,7 @@ size_t cHTTPResponseParser::Parse(const char * a_Data, size_t a_Size) if (!m_Buffer.empty()) { // Headers finished and there's still data left in the buffer, process it as message body: - m_IsInHeaders = false; + HeadersFinished(); return ParseBody(m_Buffer.data(), m_Buffer.size()); } return 0; @@ -132,6 +133,10 @@ void cHTTPResponseParser::HeadersFinished(void) { m_TransferEncodingParser = cTransferEncodingParser::Create(*this, "identity", m_ContentLength); } + else + { + m_TransferEncodingParser = cTransferEncodingParser::Create(*this, transferEncoding->second, m_ContentLength); + } } @@ -169,6 +174,7 @@ void cHTTPResponseParser::OnBodyData(const void * a_Data, size_t a_Size) void cHTTPResponseParser::OnBodyFinished(void) { + m_IsFinished = true; m_Callbacks.OnBodyFinished(); } |