Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1CDD94AA for ; Tue, 1 Nov 2011 01:43:40 +0000 (UTC) Received: (qmail 40184 invoked by uid 500); 1 Nov 2011 01:43:37 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 40122 invoked by uid 500); 1 Nov 2011 01:43:37 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 40113 invoked by uid 99); 1 Nov 2011 01:43:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 01:43:37 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [213.199.154.139] (HELO DB3EHSOBE001.bigfish.com) (213.199.154.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 01:43:31 +0000 Received: from mail84-db3-R.bigfish.com (10.3.81.244) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 14.1.225.22; Tue, 1 Nov 2011 01:42:56 +0000 Received: from mail84-db3 (localhost.localdomain [127.0.0.1]) by mail84-db3-R.bigfish.com (Postfix) with ESMTP id 0DA115E81EA for ; Tue, 1 Nov 2011 01:43:04 +0000 (UTC) X-SpamScore: -28 X-BigFish: VPS-28(zzbb2dK9371Kc89bh62a3K1447M542M1432N98dKzz1202hzz8275ch8275dhz2dh2a8h668h839h) X-Forefront-Antispam-Report: CIP:207.46.62.153;KIP:(null);UIP:(null);IPVD:NLI;H:SG1RD3HUB016.red003.local;RD:smtp601.mail.apac.microsoftonline.com;EFVD:NLI Received: from mail84-db3 (localhost.localdomain [127.0.0.1]) by mail84-db3 (MessageSwitch) id 1320111783463355_4921; Tue, 1 Nov 2011 01:43:03 +0000 (UTC) Received: from DB3EHSMHS014.bigfish.com (unknown [10.3.81.242]) by mail84-db3.bigfish.com (Postfix) with ESMTP id 624591670050 for ; Tue, 1 Nov 2011 01:43:03 +0000 (UTC) Received: from SG1RD3HUB016.red003.local (207.46.62.153) by DB3EHSMHS014.bigfish.com (10.3.87.114) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 1 Nov 2011 01:42:47 +0000 Received: from SG1RD3XVS451.red003.local ([10.112.166.181]) by SG1RD3HUB016.red003.local ([10.29.17.36]) with mapi; Mon, 31 Oct 2011 18:42:57 -0700 From: Anantaneni Harish To: Tomcat Users List Date: Mon, 31 Oct 2011 18:42:53 -0700 Subject: RE: cannot read complete HTTP request body. It reads only 8192 characters Thread-Topic: cannot read complete HTTP request body. It reads only 8192 characters Thread-Index: AcyVanJN5rk+KXK+SHKZUaBjHhiYBwCCWHSQADDrbYA= Message-ID: <76A7159F4F167A4680050E6A2B1DB0C1098994B0@SG1RD3XVS451.red003.local> References: <76A7159F4F167A4680050E6A2B1DB0C10989907B@SG1RD3XVS451.red003.local> <3451529724817954742@unknownmsgid> <76A7159F4F167A4680050E6A2B1DB0C109899134@SG1RD3XVS451.red003.local> <4EA91BB0.9060707@kippdata.de> <76A7159F4F167A4680050E6A2B1DB0C109899173@SG1RD3XVS451.red003.local> <4EA97B09.5040407@christopherschultz.net> <4EAA9B1B.2040605@ice-sa.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: vertexsoft.com Any thoughts about this? Thanks and Regards, Harish -----Original Message----- From: Anantaneni Harish=20 Sent: Monday, October 31, 2011 11:23 AM To: Tomcat Users List Subject: RE: cannot read complete HTTP request body. It reads only 8192 cha= racters String keyValuePair =3D null; String[] arrKeyValue =3D null; BufferedReader in =3D request.getReader(); while ((keyValuePair =3D in.readLine()) !=3D null) { arrKeyValue =3D keyValuePair.split("=3D"); Above code reads incomplete data(read only 8192 bytes) at my customer's env= ironment, but reads complete data in my environment. String keyValuePair =3D null; String[] arrKeyValue =3D null; BufferedReader in =3D new BufferedReader(new InputStreamReader(request.getI= nputStream())); while ((keyValuePair =3D in.readLine()) !=3D null) { arrKeyValue =3D keyValuePair.split("=3D"); Above code reads complete data in both the environments. *no changes done t= o customer's environment. I hope you can help me now by finding the reason for data lost at my custom= er's environment when using request.getReader(). Thanks and Regards, Harish -----Original Message----- From: Andr=E9 Warnier [mailto:aw@ice-sa.com]=20 Sent: Friday, October 28, 2011 9:08 PM To: Tomcat Users List Subject: Re: cannot read complete HTTP request body. It reads only 8192 cha= racters Konstantin Kolinko wrote: > 2011/10/27 Christopher Schultz : >> On 10/27/2011 4:58 AM, Anantaneni Harish wrote: >>> Thanks for the directions the Rainer. Actually the issue is just >>> solved. >>> >>> We have changed from BufferedReader in =3D request.getReader(); >>> >>> to >>> >>> BufferedReader in =3D new BufferedReader(new >>> InputStreamReader(request.getInputStream())); >>> >>> Now whole body has been read at my client's environment as well. >>> >>> But would like to know, what causes the issue. Do you have any >>> idea, why same method can read whole data in my environment and >>> does not read whole data at my customer's environment? >> You'll have to provide more information, such as the code you are >> using. >> >> I'm fairly sure Tomcat is not the source of the problem. >> >=20 > +1. >=20 > I think you need to pay more attention on the documentation of the > java.io.Reader#read() method, or maybe look for a tutorial. >=20 > See also documentation for java.io.InputStream#available(). >=20 > In short: the read() method returns a portion of data that is > currently available. If you need more data you must call read() > repeatedly in a loop until it returns -1. >=20 .. and the difference between two systems, may be that on one system, the n= etwork is=20 faster (or the system slower, or the buffer bigger) and so by the time you = do the read,=20 there are more bytes available in the buffer. > If you had provided some of your source code that performs reading, we > would be able to point at the exact error in your code. >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org