You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by lior grinfeld <li...@gmail.com> on 2007/07/09 08:59:57 UTC

how to set chunk size?

Hi,

i am trying to find out where and which attribute i can use to do transfer
data as chunk and determined the chunk size of a response.
i saw it is supported, i read it in the "Apache Tomcat Configuration
Reference - The HTTP Connector", but where can i find more details?

thanks

Lior

Re: how to set chunk size?

Posted by lior grinfeld <li...@gmail.com>.
Thanks Bill,

I already wrote a servlet that send chunked data, but since i saw in tomcat
document that tomcat support it, i thought it is something i can configure .
any way if my client support chunks i saw with wireshark that chunks size
are 2000 byte with default servlet , looks to me like default behavior of
tomcat. so probably you can set this value, so tomcat will do the job for me
( maybe better then me ??? :)  ) , so again - where to do it?


Regards
Lior

On 7/10/07, Bill Barker <wb...@wilshire.com> wrote:
>
>
> "lior grinfeld" <li...@gmail.com> wrote in message
> news:67c857860707082359s7e8de5c2i55278065bc30e7a0@mail.gmail.com...
> > Hi,
> >
> > i am trying to find out where and which attribute i can use to do
> transfer
> > data as chunk and determined the chunk size of a response.
> > i saw it is supported, i read it in the "Apache Tomcat Configuration
> > Reference - The HTTP Connector", but where can i find more details?
> >
>
> Section 5.1 of the Servlet spec might be a start :).  Setting the
> bufferSize
> on the response (assuming that this is a Servlet, not a JSP) should make
> it
> close to the chunk size (assuming you don't set it too small, like under
> 8Kb).
>
> There isn't really a practical way to guarantee the chunk size.  You would
> have to count bytes sent, and call response.flushBuffer at the magic
> number
> to have any chance of controlling the chunk size.
>
> However, this should be a waste of time, since any working HTTP/1.1 client
> would know how to parse the chunk size sent in the response body.
>
> > thanks
> >
> > Lior
> >
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 

Regards
Lior Grinfeld

Re: how to set chunk size?

Posted by Bill Barker <wb...@wilshire.com>.
"lior grinfeld" <li...@gmail.com> wrote in message 
news:67c857860707082359s7e8de5c2i55278065bc30e7a0@mail.gmail.com...
> Hi,
>
> i am trying to find out where and which attribute i can use to do transfer
> data as chunk and determined the chunk size of a response.
> i saw it is supported, i read it in the "Apache Tomcat Configuration
> Reference - The HTTP Connector", but where can i find more details?
>

Section 5.1 of the Servlet spec might be a start :).  Setting the bufferSize 
on the response (assuming that this is a Servlet, not a JSP) should make it 
close to the chunk size (assuming you don't set it too small, like under 
8Kb).

There isn't really a practical way to guarantee the chunk size.  You would 
have to count bytes sent, and call response.flushBuffer at the magic number 
to have any chance of controlling the chunk size.

However, this should be a waste of time, since any working HTTP/1.1 client 
would know how to parse the chunk size sent in the response body.

> thanks
>
> Lior
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org