|
From: <fre...@us...> - 2012-01-31 10:59:07
|
Revision: 79
http://ehs.svn.sourceforge.net/ehs/?rev=79&view=rev
Author: fredroth
Date: 2012-01-31 10:58:57 +0000 (Tue, 31 Jan 2012)
Log Message:
-----------
handling of 'request too large' and 'invalid request' seperated
Modified Paths:
--------------
trunk/ehs.cpp
Modified: trunk/ehs.cpp
===================================================================
--- trunk/ehs.cpp 2012-01-31 08:54:03 UTC (rev 78)
+++ trunk/ehs.cpp 2012-01-31 10:58:57 UTC (rev 79)
@@ -763,7 +763,6 @@
// if add buffer failed, don't read from this connection anymore
switch (nAddBufferResult) {
case EHSConnection::ADDBUFFER_INVALIDREQUEST:
- case EHSConnection::ADDBUFFER_TOOBIG:
{
// Immediately send a 400 response, then close the connection
auto_ptr<HttpResponse> tmp(HttpResponse::Error(HTTPRESPONSECODE_400_BADREQUEST, 0, *i));
@@ -772,6 +771,15 @@
EHS_TRACE("Done reading because we got a bad request");
}
break;
+ case EHSConnection::ADDBUFFER_TOOBIG:
+ {
+ // Immediately send a 413 response, then close the connection
+ auto_ptr<HttpResponse> tmp(HttpResponse::Error(HTTPRESPONSECODE_413_TOOLARGE, 0, *i));
+ (*i)->SendHttpResponse(tmp);
+ (*i)->DoneReading(false);
+ EHS_TRACE("Done reading because we got a too large request");
+ }
+ break;
case EHSConnection::ADDBUFFER_NORESOURCE:
{
// Immediately send a 503 response, then close the connection
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|