[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    Re: Bug in OracleContentStore and Fix
From:       Ingo Brunberg <ib () fiz-chemie ! de>
Date:       2003-09-18 12:41:54
[Download RAW message or body]

P.S.
The way the fix in CVS is implemented is not very good. It would leave the
contentLength at -1 even if it got a zero length file. So the two
lines should propably be shifted two lines up.

---
I don't know if it really matters, but I guess a contentLenght of -1
means the value is actually unknown whereas a value of 0 denotes an
empty file.

Regards,
Ingo

> Hi Ingo,
> 
> 	you are right the fix you are referring to also does the trick, I > overlooked it. \
> Is there a specific reason not to initialise > contentLength to 0 instead of -1? 
> Regards,
> 
> Stijn
> 
> -----Original Message-----
> From: Ingo Brunberg [mailto:ib@fiz-chemie.de]
> Sent: donderdag 18 september 2003 12:36
> To: slide-dev@jakarta.apache.org
> Subject: Re: Bug in OracleContentStore and Fix
> 
> 
> Hi Stijn,
> 
> which current nightly snapshot are you referring to? In the current
> code your line 186 actually is line 188 and there are to additional
> (at 178) lines which already contain a fix for your problem. These
> are:
> if(contentLength < 0)
> contentLength = 0;
> 
> Regards,
> Ingo
> 
> > Hi,
> > 
> > 	based on our tests (slide 1.0.16 and current nightly snapshot) we > found =
> > that when using the OracleContentStore the property 'getcontentlength' > =
> > mismatched with the actual length of the BLOB stored in Oracle (actual > =
> > BLOB size is 'getcontentlength' +1).
> > 
> > The following statements in OracleContentStore causes this behaviour:
> > 
> > 135: int contentLength =3D -1;
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > ....
> > 186: revisionDescriptor.setContentLength(contentLength);
> > 
> > OracleContentStore updates the contentLength to the (original size-1) > =
> > and this value is made persistent in the PROPERTY table.
> > 
> > This causes Slide to malfunction when downloading files because the > =
> > property 'getcontentlength' is used by GetMethod to set the =
> > contentlength of the response. The write of the last byte throws an > =
> > exception and the last buffer is never flushed to the client.
> > 
> > The solution is to initialize the contentLength to 0 instead of -1. > =
> > After this fix everything works just fine.
> > 
> > Keep up the good work,
> > 
> > Kind regards,
> > 
> > Stijn


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic