https://issues.apache.org/bugzilla/show_bug.cgi?id=49591

--- Comment #2 from km...@autonomy.com 2010-09-23 12:33:12 EDT ---
Flushing the error response as soon as possible sounds desirable, but after
giving it some thought, the response still can't be flushed until the JSP has
flushed at least once (explicitly or due to end of page), in order to allow the
JSP to set headers (as required by the JSP specification: version 2.2, section
JSP 11.3, Buffering).

So in the case that the response is complete, flushing the headers immediately
is simply an extra flush (the data should already be in the buffer).

Agreed this isn't actually a problem, and doesn't need to be fixed. I just
think it would be nice. :-) I can see how it might get complicated, though.


To provide some context, the reason I initially reported this is because I ran
into an issue with Internet Explorer's "friendly error page" feature.

Internet Explorer will display a friendly error page if the error response body
is under a certain number of bytes (512 or so by default, I think). The
interesting part is that if the response body is chunked, it doesn't wait for
the entire response body to arrive; it decides as soon as it has any part of
the response body.

So if you have a very short first chunk, and the next chunk arrives in a later
network packet, it'll assume the response is actually under the limit, and
display the friendly error page. (However, it does combine chunks that arrive
in the same packets; I'm guessing it runs the check immediately after the first
read() or whatever.) This sorta makes sense, since a chunked response is
unbounded in size, although I'm still a bit dubious as to the rationale.

Anyway, this IE-specific behavior is easy enough to work around simply by
ensuring the first chunk is large enough. (My application was flushing very
frequently, resulting in lots of small chunks. The behavior was sensitive to
network latency, so it was a bit of pain to track down.) I just reported this
because I was surprised to still see a single chunk body for errors (but not
non-errors), even after I had eliminated all the explicit flushes.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to