RE: how to send http response in several chunked package with Tomcat

2008-02-28 Thread Hanks Wang (hanwan)
My God, I am actually not aware of that despite it's so obvious...

Thank u Filip!

B.R
Han

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 28, 2008 11:51 PM
To: Tomcat Users List
Subject: Re: how to send http response in several chunked package with
Tomcat

//first flush headers
response.flushBuffer()
//then flush body
while (havedata) {
  response.getOutputStream().println(some data)
  response.flushBuffer()
}

you need to put your thinker hat on Hanks :)

Hanks Wang (hanwan) wrote:
> Hi Filip,
> Seems the method has a problem : tomcat puts the http header and part 
> of the body in the same chunk.
>
> But I hope to generate the response in below format:
> Suppose I need use String tmp as the response, tmp = part1 + part2 +
> part3+part4;
> we use 4 tcp frame totally for the http response:
>
> Frame 1: only carry the httpheader, no chunk in the frame Frame 2: 
> includes the first chunk, carries part1+part2; Frame 3: includes the 
> second chunk, carries part3+part4; Frame 4: includes a chunk whose 
> length is 0, tells client it's the end of chunks;
>
> However Tomcat generate the response in such way:
> Frame 1: includes httpheader and the first chunk, 1st chunk carries 
> part1; Frame 2: includes part2 + part3;
> Frame3 and Frame4 are same with above;
>
> So how can I make sure there is only http header in the first frame?
>
> Thanks.
> Han
>  
>
> -Original Message-
> From: Hanks Wang (hanwan)
> Sent: Thursday, February 28, 2008 10:26 PM
> To: Tomcat Users List
> Subject: RE: how to send http response in several chunked package with

> Tomcat
>
> Hi Filip,
>
> Yes it works. Thanks a lot!
>
> Christopher, in fact I'm writing a servlet to fool a management 
> software, So I need make sure the servlet response is as close to real

> device as possible.
>
> Thanks for everyone's help.
>
> B.R
> Han
> -Original Message-
> From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 27, 2008 11:24 PM
> To: Tomcat Users List
> Subject: Re: how to send http response in several chunked package with

> Tomcat
>
> you don't need to do that, tomcat does it for you.
> all you need to do is
>
> while (havedata) {
>   response.getOutputStream().println(some data)
>   response.flushBuffer()
> }
>
> and tomcat takes care of the rest
>
> Filip
>
> Hanks Wang (hanwan) wrote:
>   
>> Hi Johnny,
>>
>> I try below method implement the chunk in code:
>>
>> String tmp = "something very long";
>>
>> String hlen = Integer.toHexString(tmp.length());
>> hlen = hlen +"\r\n" + tmp.toString(); String chunkend = 
>> Integer.toHexString(0)+"\r\n"; 
>> response.getOutputStream().println(hlen);
>> response.getOutputStream().println(chunkend);
>>
>> I created two http chunk successfully by this way. The first chunk is

>> the data which wraps tmp, the second is the end chunk.
>>
>> But the question is, all these chunk and http header are in same 
>> frame
>> 
>
>   
>> (get it from wireshark.).
>>
>> How can I put them in different frame?
>> Which means we need 3 frame for the case: the first frame will carry 
>> the http header, the second will carry the first chunk data, the last

>> frame will carry the end chunk.
>>
>> Does it mean I need control the tcp/ip protocol? It's impossible,
>> 
> right?
>   
>> B.R
>> Han
>>
>>  
>>
>> -Original Message-
>> From: Hanks Wang (hanwan)
>> Sent: Wednesday, February 27, 2008 3:40 PM
>> To: Tomcat Users List
>> Subject: RE: how to send http response in several chunked package 
>> with
>> 
>
>   
>> Tomcat
>>
>> Hi Johnny,
>>
>> Thanks a lot. I read the http RFC and find something like this:
>>
>> The chunk-size field is a string of hex digits indicating the size of

>> the chunk. The chunked encoding is ended by any chunk whose size is 
>> zero, followed by the trailer, which is terminated by an empty line.
>>
>> Do u have any tutorial of ChunkedOutputFilter? I can't find anything 
>> from its API document..
>>
>> Thanks
>> Han
>>
>>
>> -Original Message-
>> From: Johnny Kewl [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, February 26, 2008 7:41 PM
>> To: Tomcat Users List
>> Subject: Re: how to send http response in several chunked package 
>> with
>> 
>
>   
>> Tomcat
>>
>>
>> --

Re: how to send http response in several chunked package with Tomcat

2008-02-28 Thread Filip Hanik - Dev Lists

//first flush headers
response.flushBuffer()
//then flush body
while (havedata) {
 response.getOutputStream().println(some data)
 response.flushBuffer()
}

you need to put your thinker hat on Hanks :)

Hanks Wang (hanwan) wrote:

Hi Filip,
Seems the method has a problem : tomcat puts the http header and part of
the body in the same chunk.

But I hope to generate the response in below format:
Suppose I need use String tmp as the response, tmp = part1 + part2 +
part3+part4;
we use 4 tcp frame totally for the http response:

Frame 1: only carry the httpheader, no chunk in the frame
Frame 2: includes the first chunk, carries part1+part2;
Frame 3: includes the second chunk, carries part3+part4;
Frame 4: includes a chunk whose length is 0, tells client it's the end
of chunks;

However Tomcat generate the response in such way:
Frame 1: includes httpheader and the first chunk, 1st chunk carries
part1;
Frame 2: includes part2 + part3;
Frame3 and Frame4 are same with above;

So how can I make sure there is only http header in the first frame?

Thanks.
Han
 


-Original Message-
From: Hanks Wang (hanwan) 
Sent: Thursday, February 28, 2008 10:26 PM

To: Tomcat Users List
Subject: RE: how to send http response in several chunked package with
Tomcat

Hi Filip,

Yes it works. Thanks a lot!

Christopher, in fact I'm writing a servlet to fool a management
software, So I need make sure the servlet response is as close to real
device as possible.

Thanks for everyone's help.

B.R
Han
-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 27, 2008 11:24 PM
To: Tomcat Users List
Subject: Re: how to send http response in several chunked package with
Tomcat

you don't need to do that, tomcat does it for you.
all you need to do is

while (havedata) {
  response.getOutputStream().println(some data)
  response.flushBuffer()
}

and tomcat takes care of the rest

Filip

Hanks Wang (hanwan) wrote:
  

Hi Johnny,

I try below method implement the chunk in code:

String tmp = "something very long";

String hlen = Integer.toHexString(tmp.length());
hlen = hlen +"\r\n" + tmp.toString();
String chunkend = Integer.toHexString(0)+"\r\n"; 
response.getOutputStream().println(hlen);

response.getOutputStream().println(chunkend);

I created two http chunk successfully by this way. The first chunk is 
the data which wraps tmp, the second is the end chunk.


But the question is, all these chunk and http header are in same frame



  

(get it from wireshark.).

How can I put them in different frame?
Which means we need 3 frame for the case: the first frame will carry 
the http header, the second will carry the first chunk data, the last 
frame will carry the end chunk.


Does it mean I need control the tcp/ip protocol? It's impossible,


right?
  

B.R
Han

 


-Original Message-
From: Hanks Wang (hanwan)
Sent: Wednesday, February 27, 2008 3:40 PM
To: Tomcat Users List
Subject: RE: how to send http response in several chunked package with



  

Tomcat

Hi Johnny,

Thanks a lot. I read the http RFC and find something like this:

The chunk-size field is a string of hex digits indicating the size of 
the chunk. The chunked encoding is ended by any chunk whose size is 
zero, followed by the trailer, which is terminated by an empty line.


Do u have any tutorial of ChunkedOutputFilter? I can't find anything 
from its API document..


Thanks
Han


-Original Message-
From: Johnny Kewl [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 26, 2008 7:41 PM
To: Tomcat Users List
Subject: Re: how to send http response in several chunked package with



  

Tomcat


--
--
---
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
Making the Java dream come true.
--
--
---
- Original Message -
From: "Hanks Wang (hanwan)" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, February 26, 2008 12:02 PM
Subject: how to send http response in several chunked package with 
Tomcat



Hi all,

Is there a way to make tomcat generate http response in 
chunked-encoding style?


suppose I have a file resp.log and I can parse it in byte[], how can I



  

send the byte array in several chunked package?


Hanks I have just started looking at this, so no expert but I did 
notice


ChunkedInputFilter,ChunkedOutputFilter

I think your answer is in setting a filter in normal Http I notice



  
that chunking happens automatically if header size ommited, but with 
so much control of the socket I think you have to pump it thru a 
filter and then there must be a way to say last chuck... and start 
chuck...
Short of that one would have to set headers the

RE: how to send http response in several chunked package with Tomcat

2008-02-28 Thread Hanks Wang (hanwan)
Hi Filip,
Seems the method has a problem : tomcat puts the http header and part of
the body in the same chunk.

But I hope to generate the response in below format:
Suppose I need use String tmp as the response, tmp = part1 + part2 +
part3+part4;
we use 4 tcp frame totally for the http response:

Frame 1: only carry the httpheader, no chunk in the frame
Frame 2: includes the first chunk, carries part1+part2;
Frame 3: includes the second chunk, carries part3+part4;
Frame 4: includes a chunk whose length is 0, tells client it's the end
of chunks;

However Tomcat generate the response in such way:
Frame 1: includes httpheader and the first chunk, 1st chunk carries
part1;
Frame 2: includes part2 + part3;
Frame3 and Frame4 are same with above;

So how can I make sure there is only http header in the first frame?

Thanks.
Han
 

-Original Message-
From: Hanks Wang (hanwan) 
Sent: Thursday, February 28, 2008 10:26 PM
To: Tomcat Users List
Subject: RE: how to send http response in several chunked package with
Tomcat

Hi Filip,

Yes it works. Thanks a lot!

Christopher, in fact I'm writing a servlet to fool a management
software, So I need make sure the servlet response is as close to real
device as possible.

Thanks for everyone's help.

B.R
Han
-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 27, 2008 11:24 PM
To: Tomcat Users List
Subject: Re: how to send http response in several chunked package with
Tomcat

you don't need to do that, tomcat does it for you.
all you need to do is

while (havedata) {
  response.getOutputStream().println(some data)
  response.flushBuffer()
}

and tomcat takes care of the rest

Filip

Hanks Wang (hanwan) wrote:
> Hi Johnny,
>
> I try below method implement the chunk in code:
>
> String tmp = "something very long";
>
> String hlen = Integer.toHexString(tmp.length());
> hlen = hlen +"\r\n" + tmp.toString();
> String chunkend = Integer.toHexString(0)+"\r\n"; 
> response.getOutputStream().println(hlen);
> response.getOutputStream().println(chunkend);
>
> I created two http chunk successfully by this way. The first chunk is 
> the data which wraps tmp, the second is the end chunk.
>
> But the question is, all these chunk and http header are in same frame

> (get it from wireshark.).
>
> How can I put them in different frame?
> Which means we need 3 frame for the case: the first frame will carry 
> the http header, the second will carry the first chunk data, the last 
> frame will carry the end chunk.
>
> Does it mean I need control the tcp/ip protocol? It's impossible,
right?
>
> B.R
> Han
>
>  
>
> -----Original Message-
> From: Hanks Wang (hanwan)
> Sent: Wednesday, February 27, 2008 3:40 PM
> To: Tomcat Users List
> Subject: RE: how to send http response in several chunked package with

> Tomcat
>
> Hi Johnny,
>
> Thanks a lot. I read the http RFC and find something like this:
>
> The chunk-size field is a string of hex digits indicating the size of 
> the chunk. The chunked encoding is ended by any chunk whose size is 
> zero, followed by the trailer, which is terminated by an empty line.
>
> Do u have any tutorial of ChunkedOutputFilter? I can't find anything 
> from its API document..
>
> Thanks
> Han
>
>
> -----Original Message-
> From: Johnny Kewl [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 26, 2008 7:41 PM
> To: Tomcat Users List
> Subject: Re: how to send http response in several chunked package with

> Tomcat
>
>
> --
> --
> ---
> HARBOR: http://coolharbor.100free.com/index.htm
> The most powerful application server on earth.
> The only real POJO Application Server.
> Making the Java dream come true.
> --
> --
> ---
> - Original Message -
> From: "Hanks Wang (hanwan)" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" 
> Sent: Tuesday, February 26, 2008 12:02 PM
> Subject: how to send http response in several chunked package with 
> Tomcat
>
>
> Hi all,
>
> Is there a way to make tomcat generate http response in 
> chunked-encoding style?
>
> suppose I have a file resp.log and I can parse it in byte[], how can I

> send the byte array in several chunked package?
>
> 
> Hanks I have just started looking at this, so no expert but I did 
> notice
>
> ChunkedInputFilter,ChunkedOutputFilter
>
> I think your answer is in setting a filter in normal Http I notice

> that chunking happens automatically if header size ommited, but wi

RE: how to send http response in several chunked package with Tomcat

2008-02-28 Thread Hanks Wang (hanwan)
Hi Filip,

Yes it works. Thanks a lot!

Christopher, in fact I'm writing a servlet to fool a management
software, So I need make sure the servlet response is as close to real
device as possible.

Thanks for everyone's help.

B.R
Han
-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 27, 2008 11:24 PM
To: Tomcat Users List
Subject: Re: how to send http response in several chunked package with
Tomcat

you don't need to do that, tomcat does it for you.
all you need to do is

while (havedata) {
  response.getOutputStream().println(some data)
  response.flushBuffer()
}

and tomcat takes care of the rest

Filip

Hanks Wang (hanwan) wrote:
> Hi Johnny,
>
> I try below method implement the chunk in code:
>
> String tmp = "something very long";
>
> String hlen = Integer.toHexString(tmp.length());
> hlen = hlen +"\r\n" + tmp.toString();
> String chunkend = Integer.toHexString(0)+"\r\n"; 
> response.getOutputStream().println(hlen);
> response.getOutputStream().println(chunkend);
>
> I created two http chunk successfully by this way. The first chunk is 
> the data which wraps tmp, the second is the end chunk.
>
> But the question is, all these chunk and http header are in same frame

> (get it from wireshark.).
>
> How can I put them in different frame?
> Which means we need 3 frame for the case: the first frame will carry 
> the http header, the second will carry the first chunk data, the last 
> frame will carry the end chunk.
>
> Does it mean I need control the tcp/ip protocol? It's impossible,
right?
>
> B.R
> Han
>
>  
>
> -----Original Message-----
> From: Hanks Wang (hanwan)
> Sent: Wednesday, February 27, 2008 3:40 PM
> To: Tomcat Users List
> Subject: RE: how to send http response in several chunked package with

> Tomcat
>
> Hi Johnny,
>
> Thanks a lot. I read the http RFC and find something like this:
>
> The chunk-size field is a string of hex digits indicating the size of 
> the chunk. The chunked encoding is ended by any chunk whose size is 
> zero, followed by the trailer, which is terminated by an empty line.
>
> Do u have any tutorial of ChunkedOutputFilter? I can't find anything 
> from its API document..
>
> Thanks
> Han
>
>
> -----Original Message-
> From: Johnny Kewl [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 26, 2008 7:41 PM
> To: Tomcat Users List
> Subject: Re: how to send http response in several chunked package with

> Tomcat
>
>
> --
> --
> ---
> HARBOR: http://coolharbor.100free.com/index.htm
> The most powerful application server on earth.
> The only real POJO Application Server.
> Making the Java dream come true.
> --
> --
> ---
> - Original Message -
> From: "Hanks Wang (hanwan)" <[EMAIL PROTECTED]>
> To: "Tomcat Users List" 
> Sent: Tuesday, February 26, 2008 12:02 PM
> Subject: how to send http response in several chunked package with 
> Tomcat
>
>
> Hi all,
>
> Is there a way to make tomcat generate http response in 
> chunked-encoding style?
>
> suppose I have a file resp.log and I can parse it in byte[], how can I

> send the byte array in several chunked package?
>
> 
> Hanks I have just started looking at this, so no expert but I did 
> notice
>
> ChunkedInputFilter,ChunkedOutputFilter
>
> I think your answer is in setting a filter in normal Http I notice

> that chunking happens automatically if header size ommited, but with 
> so much control of the socket I think you have to pump it thru a 
> filter and then there must be a way to say last chuck... and start 
> chuck...
> Short of that one would have to set headers themselves and add 
> trailing 0's and end sequences, so I think those classes are specific 
> to http11
>
>  a guess
>
> Any suggestion is welcome!
>
> Thanks
> Han
>
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, 
> e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, 
> e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, 
> e-mail: [EMAIL

Re: how to send http response in several chunked package with Tomcat

2008-02-27 Thread Filip Hanik - Dev Lists

you don't need to do that, tomcat does it for you.
all you need to do is

while (havedata) {
 response.getOutputStream().println(some data)
 response.flushBuffer()
}

and tomcat takes care of the rest

Filip

Hanks Wang (hanwan) wrote:

Hi Johnny,

I try below method implement the chunk in code:

String tmp = "something very long";

String hlen = Integer.toHexString(tmp.length());
hlen = hlen +"\r\n" + tmp.toString();
String chunkend = Integer.toHexString(0)+"\r\n";
response.getOutputStream().println(hlen);
response.getOutputStream().println(chunkend);

I created two http chunk successfully by this way. The first chunk is
the data which wraps tmp, the second is the end chunk.

But the question is, all these chunk and http header are in same frame
(get it from wireshark.).

How can I put them in different frame?
Which means we need 3 frame for the case: the first frame will carry the
http header, the second will carry the first chunk data, the last frame
will carry the end chunk.

Does it mean I need control the tcp/ip protocol? It's impossible, right?

B.R
Han

 


-Original Message-
From: Hanks Wang (hanwan) 
Sent: Wednesday, February 27, 2008 3:40 PM

To: Tomcat Users List
Subject: RE: how to send http response in several chunked package with
Tomcat

Hi Johnny,

Thanks a lot. I read the http RFC and find something like this:

The chunk-size field is a string of hex digits indicating the size of
the chunk. The chunked encoding is ended by any chunk whose size is
zero, followed by the trailer, which is terminated by an empty line.

Do u have any tutorial of ChunkedOutputFilter? I can't find anything
from its API document..

Thanks
Han


-Original Message-
From: Johnny Kewl [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 26, 2008 7:41 PM
To: Tomcat Users List
Subject: Re: how to send http response in several chunked package with
Tomcat



---
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
Making the Java dream come true.

---
- Original Message -
From: "Hanks Wang (hanwan)" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, February 26, 2008 12:02 PM
Subject: how to send http response in several chunked package with
Tomcat


Hi all,

Is there a way to make tomcat generate http response in chunked-encoding
style?

suppose I have a file resp.log and I can parse it in byte[], how can I
send the byte array in several chunked package?


Hanks I have just started looking at this, so no expert but I did notice

ChunkedInputFilter,ChunkedOutputFilter

I think your answer is in setting a filter in normal Http I notice
that 
chunking happens automatically

if header size ommited, but with so much control of the socket I think
you 
have to pump it thru
a filter and then there must be a way to say last chuck... and start 
chuck...

Short of that one would have to set headers themselves and add trailing
0's 
and end sequences,

so I think those classes are specific to http11

 a guess

Any suggestion is welcome!

Thanks
Han



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


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


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



  



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



Re: how to send http response in several chunked package with Tomcat

2008-02-27 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Han,

Hanks Wang (hanwan) wrote:
| But the question is, all these chunk and http header are in same frame
| (get it from wireshark.).

Then you need to increase the number of characters being sent. If you
really are sending "something long" as a string, it's gonna fit into a
single TCP frame. Consider sending more than, say, 1500 bytes or so.
That should cross TCP frames.

| Which means we need 3 frame for the case: the first frame will carry the
| http header, the second will carry the first chunk data, the last frame
| will carry the end chunk.

This is never going to happen. Ignore TCP frame allocations because you
can't control them.

| Does it mean I need control the tcp/ip protocol? It's impossible, right?

Pretty much. There are ways, but why would you want to?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfFcxgACgkQ9CaO5/Lv0PAWlgCeLFo/LtKMPCqTsOfRBXHvV3a4
N/EAn0AnTf+pVgmaEavRVGjVM9LzKpIo
=Ip5i
-END PGP SIGNATURE-

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



RE: how to send http response in several chunked package with Tomcat

2008-02-27 Thread Hanks Wang (hanwan)
Hi Johnny,

I try below method implement the chunk in code:

String tmp = "something very long";

String hlen = Integer.toHexString(tmp.length());
hlen = hlen +"\r\n" + tmp.toString();
String chunkend = Integer.toHexString(0)+"\r\n";
response.getOutputStream().println(hlen);
response.getOutputStream().println(chunkend);

I created two http chunk successfully by this way. The first chunk is
the data which wraps tmp, the second is the end chunk.

But the question is, all these chunk and http header are in same frame
(get it from wireshark.).

How can I put them in different frame?
Which means we need 3 frame for the case: the first frame will carry the
http header, the second will carry the first chunk data, the last frame
will carry the end chunk.

Does it mean I need control the tcp/ip protocol? It's impossible, right?

B.R
Han

 

-Original Message-
From: Hanks Wang (hanwan) 
Sent: Wednesday, February 27, 2008 3:40 PM
To: Tomcat Users List
Subject: RE: how to send http response in several chunked package with
Tomcat

Hi Johnny,

Thanks a lot. I read the http RFC and find something like this:

The chunk-size field is a string of hex digits indicating the size of
the chunk. The chunked encoding is ended by any chunk whose size is
zero, followed by the trailer, which is terminated by an empty line.

Do u have any tutorial of ChunkedOutputFilter? I can't find anything
from its API document..

Thanks
Han


-Original Message-
From: Johnny Kewl [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 26, 2008 7:41 PM
To: Tomcat Users List
Subject: Re: how to send http response in several chunked package with
Tomcat



---
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
Making the Java dream come true.

---
- Original Message -
From: "Hanks Wang (hanwan)" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, February 26, 2008 12:02 PM
Subject: how to send http response in several chunked package with
Tomcat


Hi all,

Is there a way to make tomcat generate http response in chunked-encoding
style?

suppose I have a file resp.log and I can parse it in byte[], how can I
send the byte array in several chunked package?


Hanks I have just started looking at this, so no expert but I did notice

ChunkedInputFilter,ChunkedOutputFilter

I think your answer is in setting a filter in normal Http I notice
that 
chunking happens automatically
if header size ommited, but with so much control of the socket I think
you 
have to pump it thru
a filter and then there must be a way to say last chuck... and start 
chuck...
Short of that one would have to set headers themselves and add trailing
0's 
and end sequences,
so I think those classes are specific to http11

 a guess

Any suggestion is welcome!

Thanks
Han



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


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


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



RE: how to send http response in several chunked package with Tomcat

2008-02-26 Thread Hanks Wang (hanwan)
Hi Johnny,

Thanks a lot. I read the http RFC and find something like this:

The chunk-size field is a string of hex digits indicating the size of
the chunk. The chunked encoding is ended by any chunk whose size is
zero, followed by the trailer, which is terminated by an empty line.

Do u have any tutorial of ChunkedOutputFilter? I can't find anything
from its API document..

Thanks
Han


-Original Message-
From: Johnny Kewl [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 26, 2008 7:41 PM
To: Tomcat Users List
Subject: Re: how to send http response in several chunked package with
Tomcat



---
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
Making the Java dream come true.

---
- Original Message -
From: "Hanks Wang (hanwan)" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, February 26, 2008 12:02 PM
Subject: how to send http response in several chunked package with
Tomcat


Hi all,

Is there a way to make tomcat generate http response in chunked-encoding
style?

suppose I have a file resp.log and I can parse it in byte[], how can I
send the byte array in several chunked package?


Hanks I have just started looking at this, so no expert but I did notice

ChunkedInputFilter,ChunkedOutputFilter

I think your answer is in setting a filter in normal Http I notice
that 
chunking happens automatically
if header size ommited, but with so much control of the socket I think
you 
have to pump it thru
a filter and then there must be a way to say last chuck... and start 
chuck...
Short of that one would have to set headers themselves and add trailing
0's 
and end sequences,
so I think those classes are specific to http11

 a guess

Any suggestion is welcome!

Thanks
Han



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


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



Re: how to send http response in several chunked package with Tomcat

2008-02-26 Thread Johnny Kewl


---
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
Making the Java dream come true.
---
- Original Message - 
From: "Hanks Wang (hanwan)" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Tuesday, February 26, 2008 12:02 PM
Subject: how to send http response in several chunked package with Tomcat


Hi all,

Is there a way to make tomcat generate http response in chunked-encoding
style?

suppose I have a file resp.log and I can parse it in byte[], how can I
send the byte array in several chunked package?


Hanks I have just started looking at this, so no expert but I did notice 
ChunkedInputFilter,ChunkedOutputFilter


I think your answer is in setting a filter in normal Http I notice that 
chunking happens automatically
if header size ommited, but with so much control of the socket I think you 
have to pump it thru
a filter and then there must be a way to say last chuck... and start 
chuck...
Short of that one would have to set headers themselves and add trailing 0's 
and end sequences,

so I think those classes are specific to http11

 a guess

Any suggestion is welcome!

Thanks
Han



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



RE: how to send http response in several chunked package with Tomcat

2008-02-26 Thread Hanks Wang (hanwan)
Sorry for sending again, add the version info here:
 
 
Tomcat version: 6.0
Http Connector: org.apache.coyote.http11.Http11NioProtocol
 
Thanks
 Han