Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Re: TC 4 <-oreillyMultipart-> TC5: Corrupt form data: premature ending

Dirk Griesbach

2003-12-04

Replies:

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 ?

grisi
----- Original Message -----
From: Remy Maucherat <remm@(protected)>
To: Tomcat Users List <tomcat-user@(protected)>
Sent: Thursday, December 04, 2003 4:16 PM
Subject: Re: TC 4 <-oreillyMultipart-> TC5: Corrupt form data: premature
ending


> Dirk Griesbach wrote:
>
> > R�my,
> >
> > this copy is of type
> >
> >   javax.servlet.ServletInputStream.readLine()
> >
> > acquired by
> >
> >   HttpServletRequest.getInputStream();
> >
> > Would you agree that this is a good idea ?
>
> Are you sure ?
> There's a ServletIS.readLine(byte[] b, int off, int len) method, but no
> readLine returning a String (that's in the BufferedReader).
>
> SevletIS.readLine is not optimal already (I thought nobody would use
> it). Maybe it would be a good idea to attempt to reimplement it
eventually.
>
> --
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> R�my Maucherat
> Senior Developer & Consultant
> JBoss Group (Europe) S�RL
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
> For additional commands, e-mail: tomcat-user-help@(protected)
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.