-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
We have an application that does large file uploads via HTTP, and we want
to use servlets for processing. If an error occurs, we'd like to return an
error page to the user without reading the rest of the content (over a
potentially very slow net connection).
The problem we have seen is that JRun 1.0 (Apache 1.3.6 DSO, Linux RH6)
seems to require ALL of the content to be read out of the servlet input
stream before a response or redirect can take place. In the following code:
protected void doPost(HttpServletRequest req,
HttpServletResponse resp) throws ... {
// InputStream in = req.getInputStream();
// while (in.read() >= 0);
resp.sendRedirect("/error.html");
}
If this servlet receives a POST with non-empty content, and the servlet
doesn't read all of the content, JServ will send back a server error and
log a "Premature end of script headers" error in
compat_scan_script_header_err_buf.
I think the correct behavior is that unconsumed input should be ignored and
the response should be returned, followed by a socket close. In our case
this would mean the difference between waiting a half-hour for an
unsuccessful upload versus getting immediate notification in a few seconds.
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]