You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/12/03 19:53:51 UTC
DO NOT REPLY [Bug 15032] New: -
Headers get corrupted when used with mod_jk/mod_jk2 and apache 2.0.43
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15032>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15032
Headers get corrupted when used with mod_jk/mod_jk2 and apache 2.0.43
Summary: Headers get corrupted when used with mod_jk/mod_jk2 and
apache 2.0.43
Product: Tomcat 4
Version: 4.1.12
Platform: PC
OS/Version: Linux
Status: NEW
Severity: Major
Priority: Other
Component: Connector:Coyote JK 2
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: aleftik@hotmail.com
Using the following test case the header values show content from the output
stream. This happens only when the response is relatively large and the headers
have not been requested until after a relatively large response has been
written. Definitely happens with Mozilla 1.0.1 when a user does a shift reload.
to test:
compare the output between
http://localhost:8080/search/jk_test.jsp?lines=500 (no mod_jk)
http://localhost/search/jk_test.jsp?lines=500 (with mod_jk)
<%@ page language="java" %>
<%@ page import="java.util.*, java.io.*" %>
<%! void writeHeaders(HttpServletRequest request, JspWriter out)
throws IOException {
Enumeration enum = request.getHeaderNames();
while(enum.hasMoreElements()) {
String name = (String) enum.nextElement();
String headerString = "Header Name:" + name + " Header Value:" +
request.getHeader(name);
out.print(headerString);
//print to std out to make sure it is not getting
//corrupted on the way out
System.out.println(headerString);
out.println("<br>");
}
}
%>
<%! static final DEFAULT_COUNT = 400; /*default no of lines to write*/ %>
<%
boolean writeBefore = false;
int lineCount = DEFAULT_COUNT; //should be large enought to invoke demo errors
String doWriteBefore = request.getParameter("write_before");
String lnCount = request.getParameter("lines");
writeBefore = Boolean.valueOf(doWriteBefore).booleanValue();
try {
lineCount = Integer.parseInt(lnCount);
} catch (NumberFormatException ne) {
lineCount = DEFAULT_COUNT;
} catch (NullPointerException ne) {
lineCount = DEFAULT_COUNT;
}
%>
<html>
<body>
<%-- write headers before we write a large response--%>
<% if (writeBefore) { %>
<% writeHeaders(request, out); %>
<% } %>
<%for (int i=0; i < lineCount; i++) {%>
This is a really big html file... with lots of data<br>
<% } %>
<%-- write headers after we have a written a response --%>
<% writeHeaders(request, out); %>
</body>
</html>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>