On Tue, 2003-02-04 at 22:48, Guido Serassio wrote:
> Hi Robert,
> 
> At 22.29 03/02/2003, Robert Collins wrote:
> >On Tue, 2003-02-04 at 05:00, Guido Serassio wrote:
> >
> >
> > > - File open is forced in binary mode
> >
> >This is a wrong way to tackle (whatever) problem you've encounteded. The
> >caller of this function specifies the mode as binary or text. I'm
> >applying the rest of the patches though.
> 
> I have just found the reason of this:
> On Windows, when opening a file as O_TEXT, the resulting bytes count from a 
> read() can be different from the real disk size.

Yep.

> So errorTryLoadText() in errorpage.cc and netdbReloadState() in net_db.c 
> doesn't work correctly.
> 
> So, attached there is a patch to fix this.
> 
> Only a question, O_TEXT is really needed ?, or we can simply change O_TEXT 
> to O_BINARY for all platforms ?

squid.conf and mime.conf should be O_TEXT. Textual log files should be
O_TEXT. database log files (swap.state for instance, and netdb) should
be O_BINARY for all.

> Another thing:
> 
> I have discovered a bug in errorTryLoadText() when the read() fails: a NULL 
> pointer is used in string functions. In the attached patch there is a fix 
> to this too.
> The problem is present in 2.5 too.

Ok. Well, for now, lets make both netdb and errorTryLoadText use
O_BINARY.  Long term errorTryLoadText should use text mode, as Henrik
indicated.

Rob.

-- 
GPG key available at: <http://users.bigpond.net.au/robertc/keys.txt>.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to