httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: [PATCH] default_handler and no directory_walk
Date Fri, 22 Mar 2002 20:12:02 GMT
>
> On Fri, 22 Mar 2002, Bill Stoddard wrote:
>
> > Here is a patch to error out if the default handler is entered w/o directory walk
being
> > done. I believe strongly that we should not attempt to recover from this error (ie
> > "back-up and try directory walk"). This failure means that a module is defective
and
that
> > module should be fixed.
>
> > +    if (!req_cfg->directory_walked) {
> > +        ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, r,
> > +                      "directory_walk was not performed for file: %s",
> > +                      apr_pstrcat(r->pool, r->filename, r->path_info,
NULL));
> > +        return HTTP_NOT_FOUND;
> > +    }
> > +
>
> More comments from the peanut gallery: If this request is being refused
> because of a broken module, shouldn't that be 500 Internal Server Error
> rather than 404 File Not Found?
>
> Joshua.
>

Perhaps. I think I prefer 404 though.  I've not thought this completely through but it is
not inconceivable that a module author could rely on this behaviour to protect against
race conditions between when the map_to_storage hook is entered and the handler being
entered.  A modules map_to_storage hook may 'claim' the request then the handler DECLINES
because some state information in the module has changed between the time the
map_to_storage hook was run and the handler running. Easy enough to code around this
though... I am not even sure I want a patch like this going into the server...

Bill


Mime
View raw message