tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: cannot read complete HTTP request body. It reads only 8192 characters
Date Tue, 01 Nov 2011 10:45:24 GMT
2011/10/31 Anantaneni Harish <anantaneni.harish@vertexsoft.com>:
> String keyValuePair = null;
> String[] arrKeyValue = null;
> BufferedReader in = request.getReader();
> while ((keyValuePair = in.readLine()) != null) {
> arrKeyValue = keyValuePair.split("=");
>
> Above code reads incomplete data(read only 8192 bytes) at my customer's environment,
but reads complete data in my environment.
>
> String keyValuePair = null;
> String[] arrKeyValue = null;
> BufferedReader in = new BufferedReader(new InputStreamReader(request.getInputStream()));
> while ((keyValuePair = in.readLine()) != null) {
> arrKeyValue = keyValuePair.split("=");
>
> Above code reads complete data in both the environments. *no changes done to customer's
environment.
>
> I hope you can help me now by finding the reason for data lost at my customer's environment
when using request.getReader().
>
> Thanks and Regards,
> Harish
>

The code looks OK.
The readLine() implementation is provided by
org.apache.catalina.connector.CoyoteReader.

Looking at the history of that class, there is a known issue
https://issues.apache.org/bugzilla/show_bug.cgi?id=42727
"CoyoteReader readLine returns null for some post request bodies that
are a multiple of MAX_LINE_LENGTH in size"

but it should have been fixed in 5.5.27 and thus in 5.5.28 if that is
the version that your customer is using.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message