-
1. Re: AJP Flush Packet causing text/plain output
reisler Sep 25, 2007 6:09 AM (in response to reisler)An update:
I neglected to note that I think the reason this flush buffer upsets Apache is that Apache is forced to flush a response without any of the header information from Tomcat. So it uses the default type, and chunked encoding (because it doesn't know the length), and can't send any of the other headers.
In despeartion, I created a patch to mod_jk 1.2.25 that seems to solve the symptom:
diff jk_ajp_common.c jk_ajp_common.orig
1742,1751d1741
< // Removing extra flush buffer if we do not need it.
< if (headeratclient == JK_FALSE) {
< int code = (int)jk_b_pget_byte(op->reply,0);
< unsigned int len = (unsigned int)jk_b_pget_int(op->reply,1);
< if ((code == JK_AJP13_SEND_BODY_CHUNK) && (len == 0)) {
< jk_log(l, JK_LOG_DEBUG, "Received flushbuffer -- ignoring");
< continue;
< }
< }
<
This might be a good check to have in mod_jk regardless, but there is still the issue as to whether Tomcat should be sending this at all.