httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: sub_req_lookup_simple bug?
Date Mon, 31 Mar 1997 03:35:48 GMT
Aie!  Ok I dug more.  I'm sorry I did :)

It definately is a bug to not call file_walk and location_walk, but I'm
having trouble thinking of a fix that doesn't suck performance.  It's a
pig because of how mod_dir and mod_negotiation will create lots o' sub
requests all through sub_req_lookup_file, expecting sub_req_lookup_simple
to speed up the "simple" cases.

I was thinking of just folding in the _simple case into _file by avoiding
directory_walk, but I wasn't sure how to figure out if the call to
file_walk/location_walk changed the access permissions requiring the access
checks to be redone.  Essentially the only heuristic I could use is
"were any <Files> or <Location> sections valid?  If so then redo the
access checks".  I guess I just need some way to get that result from
file_walk and location_walk.

The bugs so far:

- sub_req_lookup_file doesn't call location_walk and sub_req_lookup_simple
    doesn't call location_walk or file_walk.

- sub_req_lookup_simple doesn't copy the request_time, or a few
    other fields.  Might not matter much unless a sub-request of a simple
    sub-request is done.

- sub_req_lookup_file doesn't build rnew->uri but sub_req_lookup_simple
    does.  So, for example, #include file="x" and #include file="a/x"
    behave quite differently.  Yeah we say #include file is deprecated.
    But I'm not sure that the other uses of sub_req_lookup_file are
    unaffected by this.

- handle_multi not merging headers properly, and other little ones in
    mod_negotiation (I'll post a separate [PATCH] message for these)

- (not a bug, just a performance note):  adding a stat() result cache
    could be a win -- check_symlinks and get_path_info conspire to stat()
    the same file 4 times in the config I'm working with, and directories
    get stat()d many many times.

BTW I tried replacing sub_req_lookup_file with sub_req_lookup_uri in
mod_negotiation but that doesn't work properly when there's PATH_INFO
involved.  (i.e. cp /cgi-bin/printenv /cgi-bin/t.cgi, and access
/cgi-bin/t/foobar, it'll loop looking at /cgi-bin/t/t/t/t/t.../t/foobar
until it gets to MAXPATHLEN or something like that)


P.S. All this just because I want to be able to turn tracking cookies on
and off by file extension and I decided to use <Files> instead of inventing
a new syntax.  :(

On Fri, 28 Mar 1997, Roy T. Fielding wrote:

> >sub_req_lookup_file bypasses most of its work if there is no /
> >in the new_file.  But there's no file_walk or location_walk inside
> >sub_req_lookup_simple.  I'd believe the / heuristic when only <Directory>
> >and .htaccess are involved, but I'm pretty sure we now need to call
> >file_walk and location_walk.
> Sounds reasonable to me.  OTOH, I haven't a clue as to how <Directory>,
> <Location>, and <File> interact in practice -- it was hard enough just
> trying to figure out how directory_walk alone worked, and I've long
> since forgotten that.  We have no documentation on it (not even Ben's book
> covers the subject).
> .....Roy

View raw message