Bug 42003 - Need to increase the maximum buffer size for HTTP header from 16k to 64k.
Summary: Need to increase the maximum buffer size for HTTP header from 16k to 64k.
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: unspecified
Hardware: PC Windows Server 2003
: P1 critical (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2007-03-30 15:57 UTC by Calin Gruita
Modified: 2008-10-05 03:10 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Calin Gruita 2007-03-30 15:57:32 UTC
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.
Comment 1 Calin Gruita 2007-03-30 16:05:26 UTC
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 */
Comment 2 Christopher A Johnson 2007-10-31 08:23:58 UTC
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

\jk\java\org\apache\coyote\Constants.java(95): public static final int

Comment 3 Rainer Jung 2007-11-02 19:17:50 UTC
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


especially for the related config parameter on the Tomcat side.

Please report your findings back.


Comment 4 Rainer Jung 2007-12-18 06:29:50 UTC
This should have been fixed by Mladens commit r594798 on 2007-11-14: Fix Bz
42003 by dynamically allocating memory.
Comment 5 Rainer Jung 2008-01-01 16:32:30 UTC
Move a couple of fixed JK issues from resolved to closed.