Re: Content-Length limited to 2^31-1???

2001-08-30 Thread Dmitry Rogatkin

You can always provide content length value using setHeader like methods to avoid int 
limitations. Tomcat shouldn't overwrite header value if it's already set. You can also 
use chunked out where content length simple ignored for files greater than 2GB.

Dmitry R., [EMAIL PROTECTED]
Chief Software Architect, MetricStream.COM
Santa Clara, CA






-Original Message-
From:David Daney [EMAIL PROTECTED]
Sent:Thu, 30 Aug 2001 14:47:40 -0700
To:  [EMAIL PROTECTED]
Subject: Content-Length limited to 2^31-1???


The problem I am having is that tomcat 3.2.3 seems to (kind of) limit 
content length to Integer.MAX_VALUE (2^31-1 or 2GB).

If I want to serve very large objects things do not work so well.

I seems that ServletResponse.SetContentLength(int) is the prefered 
manner to sent the content length of a servlet response and that the 
default implemtation for the "HEAD" method in HttpServlet also is 
limited to the range of int values.

My reading of the HTTP/1.1 spec does not indicate that there are any 
limitations to content length in the HTTP protocol.

So my question is:  Am I all messed up, or is Tomcat and the servlet 
spec/implementation sub-optimal?

David Daney




___
Visit http://www.visto.com.
Find out  how companies are linking mobile users to the 
enterprise with Visto.




Re: Content-Length limited to 2^31-1???

2001-08-30 Thread Tim O'Neil

At 02:47 PM 8/30/2001, you wrote:
>The problem I am having is that tomcat 3.2.3 seems to (kind of) limit 
>content length to Integer.MAX_VALUE (2^31-1 or 2GB).
>
>If I want to serve very large objects things do not work so well.
>
>I seems that ServletResponse.SetContentLength(int) is the prefered manner 
>to sent the content length of a servlet response and that the default 
>implemtation for the "HEAD" method in HttpServlet also is limited to the 
>range of int values.
>
>My reading of the HTTP/1.1 spec does not indicate that there are any 
>limitations to content length in the HTTP protocol.
>
>So my question is:  Am I all messed up, or is Tomcat and the servlet 
>spec/implementation sub-optimal?

The limit of an int is an int, right?
The setContentLength() method takes an int. What
do you want? Rather than try to stuff all your
data in one go you should treat it like the stream
that it is and feed your data into a buffer a blob
at a time, send that data down the pipe when you get
one full blob, and replenish the buffer with a new
blob of data from your source, like most anyone else
would do. Then you don't worry about how much data
you have to send. It could be gigs * gigs. Plus
you have the ability to resend any blobs (records,
frames) that get garbled on the way over, if any.

Much more efficient than trying to stuff your entire
wad down the wire.




RE: Content-Length limited to 2^31-1???

2001-08-30 Thread Martin van den Bemt

tomcat 3.2.3 is not http 1.1.. 

Mvgr,
Martin

> -Original Message-
> From: David Daney [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 30, 2001 11:48 PM
> To: [EMAIL PROTECTED]
> Subject: Content-Length limited to 2^31-1???
> 
> 
> The problem I am having is that tomcat 3.2.3 seems to (kind of) limit 
> content length to Integer.MAX_VALUE (2^31-1 or 2GB).
> 
> If I want to serve very large objects things do not work so well.
> 
> I seems that ServletResponse.SetContentLength(int) is the prefered 
> manner to sent the content length of a servlet response and that the 
> default implemtation for the "HEAD" method in HttpServlet also is 
> limited to the range of int values.
> 
> My reading of the HTTP/1.1 spec does not indicate that there are any 
> limitations to content length in the HTTP protocol.
> 
> So my question is:  Am I all messed up, or is Tomcat and the servlet 
> spec/implementation sub-optimal?
> 
> David Daney
> 
>