tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <>
Subject Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5
Date Sun, 16 Nov 2003 21:32:33 GMT
Bill Barker wrote:
>>Bill Barker wrote:
>>>I'm -1 on this.  It gives the Servlet no indication that anything is
> wrong,
>>>and leaves junk in the input stream for the next keep-alive request.  I
>>>think that it would be better to handle this in the Adaptor's
>>>postParseRequest method.
>>I disagree: the problem with this is that we allocate one array right
>>away based on content-length, not that there's a big upload (which is
> fine).
> The Adaptor can check for this:
>   if("POST".equalsIgnoreCase(request.getMethod()) &&
>      "application/x-www-form-urlencoded".equals(contentType) &&
>      request.getContentLength() > connector.getMaxPostSize()) {
>           response.setStatus(413);
>           response.setMessage("POST Body exceeds maximum");
>           return false;
>    }

This is not very efficient (doing checks there as well as in parse 
parameters), and what if the servlet intended to stream the body by 
itself ? (in this case, there's no particular efficiency problem)
So that's why I did do the check lazily (like the parsing itself, which 
must be lazy).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message