R�my,

how would you have done it ?
Maybe there can be applied a fix to it.

grisi
----- Original Message -----
From: Remy Maucherat <[EMAIL PROTECTED]>
To: Tomcat Users List <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 6:37 PM
Subject: Re: TC 4 <-oreillyMultipart-> TC5: Corrupt form data: premature
ending


> Dirk Griesbach wrote:
>
> > R�my,
> >
> > I'm quite sure. With a summary of oreilly�s sources I see:
> >
> > class MultipartParser {
> > ...
> > private ServletInputStream in;
> > private byte[] buf = new byte[8 * 1024];
> > ...
> > ServletInputStream in = req.getInputStream();
> > ...
> > do {
> >       String line = readLine();
> >       if (line == null) {
> >         throw new IOException("Corrupt form data: premature ending");
<----
> > thrown when using TC5, but not on TC4
> >       }
> > ...
> > private String readLine() throws IOException {
> >     int result;
> > StringBuffer sbuf = new StringBuffer();
> > ....
> >     do {
> >       result = in.readLine(buf , 0, buf.length);
> >  ...
> >  sbuf.append(new String(buf, 0, result, encoding));
> >         }
> > ...
> >  return sbuf.toString();
> > }
> > }
> >
> > looks quite normal, doesn't it ?
>
> If they're doing *that*, they might as well use the buffered reader
> readLine method ;-)
>
> Byte by byte input works (it's inefficent, obviously, but it works).
> I recommend adding some debug in their readLine method to see what is
> being returned.
>
> --
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> R�my Maucherat
> Senior Developer & Consultant
> JBoss Group (Europe) S�RL
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to