Changes HTTP response parser behavior to only read response bodies when a content length header is present

This commit is contained in:
Peter Thorson
2013-03-31 21:16:33 -05:00
parent 8587647657
commit 800028d1a9

View File

@@ -219,8 +219,10 @@ inline void response::process(std::string::iterator begin,
inline size_t response::process_body(const char *buf, size_t len) {
// If no content length was set then we read forever and never set m_ready
if (m_read == 0) {
m_body.append(buf,len);
return len;
//m_body.append(buf,len);
//return len;
m_state = DONE;
return 0;
}
// Otherwise m_read is the number of bytes left.