diff options
author | Chris Wilson <chris+github@qwirx.com> | 2009-01-04 13:42:19 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2009-01-04 13:42:19 +0000 |
commit | 4c118b664a47228a06b8cdec94e4d92049c7f78e (patch) | |
tree | 79a2a2c51ab3648adc277a099fc4d84854f7cceb /lib | |
parent | e9070532716f24451850b1434606be0802524354 (diff) |
Add HTTP status code 400, method not allowed.
Fix calculation of remaining content size when some bytes were buffered
by the IOStreamGetLine.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/httpserver/HTTPResponse.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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()); } |