Rainer,

Thank you very much for the prompt response.

To be more specific, Apache CXF is the consumer of HTTP request. Are
you indicating that Apache CXF is the one reading from Socket input
stream ? And that Tomcat HTTP Connector simply hands over the
Inputstream to CXF to consume the chunked contents ?

-mahesh

On Thu, Mar 5, 2009 at 10:39 AM, Rainer Jung <rainer.j...@kippdata.de> wrote:
> On 05.03.2009 16:16, Mahesh Seshan wrote:
>>
>> Hello,
>>
>> I can obtain the content-length of a HTTP Servlet Request when the
>> Content-Length header is added by the client. However, when the
>> Transfer-encoding is chunked, how do I programatically obtain the
>> content length ?
>
> You can't without consuming the body.
>
>> The task at hand for me is to prevent a HTTP client from issuing a
>> request that has a huge payload that could pose a resource risk on the
>> HTTP server.
>
> Exactly that's the reason, why there is no easy way to get the length.
> Whatever component that could provide you with that information would need
> to read all of the body (and buffer it for your later use) in order to
> measure its length.
>
> Chunked encoding works with chunks, individual chunks usually are small and
> the protocol tells us, how big the next chunk is, but we never know how big
> the size of all chunks together is.
>
> Regards,
>
> Rainer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to