Curious you mean by this? What is obvious?
It's quite simple. You've made a number of claims in your two threads,
every time supposedly verified by yourself, and for every one of them,
I can tell you that the opposite is actually true. So there's really
nothing to talk about ...

I have to oppolgise here. I thought I had tested the case of flush() after writing no data and returning - pardon. It only returns a 0 length chunk if I flush once after writing some data. If I flush once with no data it writes nothing and the client times out expecting a chunk length (which I would consider another bug) I would think it should ignore all zero length flushes, and wait to write the terminal chunk when service() returns.

A complete simple test (which I actually ran just now) and it's results are below - this is easily reproducable Hopefully this will make the cut :)

Unless dropping the first data filled chunk is defined as proper and documented, and supported, behavior, I would consider this a bug.

The servlet:

    public void service( ServletRequest req,
                         ServletResponse res)
        throws IOException
    {
        try
        {
             req.getInputStream();
             java.io.OutputStream os = res.getOutputStream();

             os.flush();
             os.write("Line Of Text 0\n".getBytes());
             os.flush();
             os.write("Line Of Text 1\n".getBytes());
             os.flush();
        }
        catch (Exception e)
        {
             System.out.println("servlet: exception! " + e);
        }
    }

The above when hit by client returns:
****
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Sun, 11 Mar 2007 22:44:02 GMT

f
Line Of Text 1

0

********

The same servlet with:

             os.flush();
             os.write("Line Of Text 0\n".getBytes());
             os.flush();
             // os.write("Line Of Text 1\n".getBytes());
             // os.flush();

When hit by client returns:
****
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Sun, 11 Mar 2007 22:44:54 GMT

0

****

The same servlet again with:

             os.flush();
             // os.write("Line Of Text 0\n".getBytes());
             // os.flush();
             // os.write("Line Of Text 1\n".getBytes());
             // os.flush();

When hit by client returns:
****
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Sun, 11 Mar 2007 22:29:12 GMT

client: exception java.net.SocketTimeoutException: Read timed out
****

Peter K



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

Reply via email to