[Box Backup-commit] COMMIT r2431 - box/trunk/lib/httpserver

boxbackup-dev at boxbackup.org boxbackup-dev at boxbackup.org
Sun Jan 4 13:42:20 GMT 2009


Author: chris
Date: 2009-01-04 13:42:19 +0000 (Sun, 04 Jan 2009)
New Revision: 2431

Modified:
   box/trunk/lib/httpserver/HTTPResponse.cpp
Log:
Add HTTP status code 400, method not allowed.

Fix calculation of remaining content size when some bytes were buffered 
by the IOStreamGetLine.


Modified: box/trunk/lib/httpserver/HTTPResponse.cpp
===================================================================
--- box/trunk/lib/httpserver/HTTPResponse.cpp	2009-01-03 18:58:43 UTC (rev 2430)
+++ box/trunk/lib/httpserver/HTTPResponse.cpp	2009-01-04 13:42:19 UTC (rev 2431)
@@ -71,6 +71,7 @@
 	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 @@
 			THROW_EXCEPTION(HTTPException, NotImplemented);
 		}
 
+		mContentLength -= rGetLine.GetSizeOfBufferedData();
+
 		Write(rGetLine.GetBufferedData(),
 			rGetLine.GetSizeOfBufferedData());
 	}




More information about the Boxbackup-commit mailing list