From 800028d1a946934ff64ac0f90ba14056beda4a50 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Sun, 31 Mar 2013 21:16:33 -0500 Subject: [PATCH] Changes HTTP response parser behavior to only read response bodies when a content length header is present --- websocketpp/http/impl/response.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/websocketpp/http/impl/response.hpp b/websocketpp/http/impl/response.hpp index 08b2eb9217..0882fd8bf8 100644 --- a/websocketpp/http/impl/response.hpp +++ b/websocketpp/http/impl/response.hpp @@ -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.