tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Wille" <mwi...@donerus.com>
Subject Re: Client prematurely closes connection = junk in reponse
Date Thu, 10 Jul 2003 17:53:22 GMT
>>> bill@tangoone.com 07/09/03 10:44PM >>>
>See below...

>On Wed, 2003-07-09 at 15:10, Michael Wille wrote:
>> Hello All,
>> byte[] buffer = new byte[1024];
>> int numBytes = 0;
>> int totalBytes = 0;
>> while(totalBytes < fileLength) {
>>     numBytes = fis.read(buffer);
>>     totalBytes += numBytes;
>>     outStream.write(buffer);
>> } 
>
>You don't want to write the whole buffer, just what was read. Try 
>write(buffer, 0, numBytes )

I've made that change you suggested, but I doubt that would cause the problem we are seeing.
 Wouldn't it simply corrupt the file itself?

Here is a screenshot of the junk response we get:
http://phatness.com/~kmw/error.gif

In it, you can see the garbage being sent to the client, then the actual HTTP headers.

Thanks,
Mike


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message