tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wei Zheng" <>
Subject POST data truncation with stand-alone Tomcat 3.2.3
Date Wed, 10 Oct 2001 18:37:03 GMT

I am using Tomcat 3.2.3 stand-alone on port 8080 running on windows 2000
Professional. (AJP13)
We have a servlet that gets POST data that range from 2k - 500k+ in size.
And from time to time, we will get data truncation when trying to read the
POST data.  We are using HttpSevletRequest.getInputStream() to read data
from the http request. (see code below)

Now the data truncation is completely random, sometimes it will truncate on
really small POST data size (4k), sometimes it will truncate on really large
POST (> 400k) and sometimes it will read in the entire request (>500k) with
no issues.  My initial suspicion is that tomcat 3.2.3 does not support
http/1.1 standalone, hence the data post got reset because there's no
persistent connection.

I have then tried hooking tomcat into IIS 5.0 on windows, and the problem
went away.  But we are trying to not use IIS if possible.  And of course on
*nix platform, we can use apache.  Is there any work around to this problem
for tomcat 3.2.3 standalone on windows?  Any other ideas to why this might
be happening?  Is it true that tomcat 3.2.3 standalone doesn't support

Thanks much,

- Wei
ps, I have seen an issue with data truncation at ~8k being metioned before
as a size limit on POST data, but I think that problem has been fixed in
3.2.3 version of tomcat with the ajp13 connector.

Here's a snippet of the code:
   ServletInputStream sis= request.getInputStream();
   String contentType= request.getContentType();
   int contentLength= request.getContentLength();
   DebugOut.print("Content Type: " + contentType);
   DebugOut.print("Content Length: " + contentLength);

   if (contentLength > 0)
    byte[] isChar= new byte[contentLength];
    int numbytes= isChar,0,contentLength );
    DebugOut.print("Number of bytes read: " + numbytes); <-- this is where
bytes read doesn't equal to content length

View raw message