httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <>
Subject Re: win32 os_stat question
Date Thu, 09 Jul 1998 19:34:07 GMT
On Thu, 9 Jul 1998, Ben Laurie wrote:

Regarding asserts, the problem is that they are being used as an excuse to
avoid proper error checking and handling.  It is not the general style of
the Apache code to assert everywhere and just die if it isn't happy with a
condition.  It is completely inexcusable in a server, especially a
threaded one, to have the whole thing exit just because an unexpected
condition was reached without proper error checking.

Because of the way asserts are used without logging anything useful and in
replacement of proper error checking, it took me a good half hour to
configure Apache so it would run on my box, starting from the current code
tree.  I ran into numerous cases where all I would get is a useless assert
that doesn't tell me anything, then I would have to go into the code and
hack in debugging messages to say what is going on.  

I think we should add something to the style guide about assert()s not
being a replacement for proper error handling.

> > Second, I don't understand the first assert in os_stat.
> > 
> >     ap_assert(szPath[1] == ':' || szPath[1] == '/');    // we are dealing with either
UNC or a drive
> >     if(szPath[0] == '/') {
> >         [...]
> > 
> > What the heck is that?  We say it can't be something, then we check
> > to see if it is something?  This makes my config with "/apache"
> > for paths die here.  Changing the szPath[1] to szPath[0] makes
> > it work for me, but I don't know the intent here.
> I don't understand what you think we say it can't be but then check for,
> but anyway, the intent is that you should supply an absolute path. That
> means it either starts with x:/ or //somemachine. /apache is incorrect:
> you've missed out the drive.

Why is /apache incorrect?  The docs say it should work, it works fine for
me if I remove the assert.  It was only broken when you added stuff to
deal with UNCs.


     * The directives that accept filenames as arguments now must use   
       Windows filenames instead of Unix ones. However, because Apache   
       uses Unix-style names internally, you must use forward slashes,  
       not backslashes. Drive letters can be used; if omitted, the drive 
       with the Apache executable will be assumed.                  

> > Also, a trailing '/' on a directory name (ie. /apache/, don't
> > know about c:/apache/) makes the server refuse to start.
> > 
> > Then comes the fact that "Directory /" blows up in
> > sub_canonical_filename.  Wee problem given that the default
> > config file includes that.
> > 
> > While compared to it taking three hours for me to change
> > my dialup networking to use a different modem and connect
> > to a different server (not because I didn't know how, just
> > because I had to reboot a zillion times and deal with the
> > configuration programs crashing), taking me half an hour
> > to make Apache work isn't bad, it really isn't quite decent
> > for release...
> Can you say "beta"?

Yea, but I have this odd idea that the config files as shipped should

View raw message