Currently the maximum buffer size for HTTP headers in the native JK connector is 16k. However, this size is not sufficient in case the HTTP header is larger than 16k (i.e. large Kerberos Tickets). If such a case arises an error of the type “[error] jk_isapi_plugin.c (1135): failed to init service for request” gets raised. For this reason the maximum buffer size, which currently is hard- coded to 16k, must be increased to 64k.
The code change required to fix this bug is to modify line# 1498 in the jk_isapi_plugin.c file to look like this: char huge_buf[64 * 1024]; /* should be enough for all */
The buffer size can be increased by modifying the source code associated with the iis dll and the AJP protocol. I was only successful in producing a working dll by using Visual Studio 6 sp5 with the associated x86 makefile. The iis dll code base requires the following changes are made: native\iis\jk_isapi_plugin.c(1977): char huge_buf[64 * 1024]; native\common\jk_ajp12_worker.c(38): #define READ_BUF_SIZE (64*1024) native\common\jk_ajp13.h(39): #define AJP13_READ_BUF_SIZE (64*1024) native\common\jk_ajp14.h(41): #define AJP14_READ_BUF_SIZE (64*1024) native\common\jk_msg_buff.h(34): #define DEF_BUFFER_SZ (64 * 1024) native\common\jk_sockbuf.h(26): #define SOCKBUF_SIZE (64*1024) native\common\jk_status.c(39): #define HUGE_BUFFER_SIZE (64*1024) native\common\jk_util.c(115): #define HUGE_BUFFER_SIZE (64*1024) In addition the following change will need to be made to one of the AJP protocol classes: \jk\java\org\apache\coyote\Constants.java(95): public static final int MAX_PACKET_SIZE = 65536;
Please try combining native\iis\jk_isapi_plugin.c(1977): char huge_buf[64 * 1024]; with the attribute max_packet_size first. See the description on the docs page http://tomcat.apache.org/connectors-doc/reference/workers.html especially for the related config parameter on the Tomcat side. Please report your findings back. Thanks! Rainer
This should have been fixed by Mladens commit r594798 on 2007-11-14: Fix Bz 42003 by dynamically allocating memory.
Move a couple of fixed JK issues from resolved to closed.