response.AddHeader("Content-Type", "text/html");
String msg = "<h1>Not found</h1>";
response.WriteBody(msg.CStr(), msg.GetLength());
- response.Finish();
return;
}
}
{
ASSERT(m_State == HttpResponseHeaders || m_State == HttpResponseBody);
+ if (count == 0)
+ return;
+
if (m_Request.ProtocolVersion == HttpVersion10) {
if (!m_Body)
m_Body = new FIFO();
void HttpResponse::Finish(void)
{
+ ASSERT(m_State != HttpResponseEnd);
+ m_State = HttpResponseEnd;
+
if (m_Request.ProtocolVersion == HttpVersion10) {
if (m_Body)
AddHeader("Content-Length", Convert::ToString(m_Body->GetAvailableBytes()));