You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Randy Layman <ra...@aswethink.com> on 2001/10/10 20:14:52 UTC

RE: POST data truncation with stand-alone Tomcat 3.2.3

	Tomcat 3.x only supports HTTP 1.0.  If you want to use HTTP 1.1 you
can either:
	1.  Upgrade to Tomcat 4
	2.  Use another like IIS or Apache (which does run on Windows)

	Randy


> -----Original Message-----
> From: Wei Zheng [mailto:zheng@cohesiant.com]
> Sent: Wednesday, October 10, 2001 2:37 PM
> To: tomcat-user@jakarta.apache.org
> Subject: POST data truncation with stand-alone Tomcat 3.2.3
> 
> 
> Hi,
> 
> 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
> http/1.1?
> 
> 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:
> /****
> try
>   {
>    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= sis.read( isChar,0,contentLength );
>     DebugOut.print("Number of bytes read: " + numbytes); <-- 
> this is where
> bytes read doesn't equal to content length
>    }
>   }
> */
>