From 4c118b664a47228a06b8cdec94e4d92049c7f78e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 4 Jan 2009 13:42:19 +0000 Subject: Add HTTP status code 400, method not allowed. Fix calculation of remaining content size when some bytes were buffered by the IOStreamGetLine. --- lib/httpserver/HTTPResponse.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/httpserver/HTTPResponse.cpp') diff --git a/lib/httpserver/HTTPResponse.cpp b/lib/httpserver/HTTPResponse.cpp index c7235695..87d4295e 100644 --- a/lib/httpserver/HTTPResponse.cpp +++ b/lib/httpserver/HTTPResponse.cpp @@ -71,6 +71,7 @@ const char *HTTPResponse::ResponseCodeToString(int ResponseCode) case Code_Found: return "302 Found"; break; case Code_NotModified: return "304 Not Modified"; break; case Code_TemporaryRedirect: return "307 Temporary Redirect"; break; + case Code_MethodNotAllowed: return "400 Method Not Allowed"; break; case Code_Unauthorized: return "401 Unauthorized"; break; case Code_Forbidden: return "403 Forbidden"; break; case Code_NotFound: return "404 Not Found"; break; @@ -354,6 +355,8 @@ void HTTPResponse::Receive(IOStream& rStream, int Timeout) THROW_EXCEPTION(HTTPException, NotImplemented); } + mContentLength -= rGetLine.GetSizeOfBufferedData(); + Write(rGetLine.GetBufferedData(), rGetLine.GetSizeOfBufferedData()); } -- cgit v1.2.3