final target file if check for symlinks reveals it's an APR_LNK, but this
is preferable to the convoluted code required to 'reuse' the original stat.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91822 13f79535-47bb-0310-9956-ffa450edef68
behavior than the old path_info logic.
If the stat() of r->filename succeeds ignore every segment that requires
no symlink check (and on Win32/OS2/Netware the name matches the canonical
name, assuring us that the case/aliases match the true name.)
This optimization can be improved by establishing a second cache of the
actual partial filenames that _are_ tested for symlinks (or canonical
filename case), and then skiping such tests when the conditions match on
successive passes for subrequests or redirects.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91816 13f79535-47bb-0310-9956-ffa450edef68
ap_directory_walk. The strlen calls, in particular, had
ranked as a top bottleneck in the usr-space code in recent
performance profiling.
Submitted by: Brian Pane <bpane@pacbell.net>
Reviewed by: Justin Erenkrantz
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91746 13f79535-47bb-0310-9956-ffa450edef68
We need to allocate storage space for the terminating NULL AND the extra /
we may tack on to the string at some point.
How in the hell the stars were aligned for this to corrupt newv via the
strcat at line 580 is unknown.
Resolves segfault seen on daedalus.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91607 13f79535-47bb-0310-9956-ffa450edef68
as well as the /manual/ returning docroot/index. Need to look for another
solution. I'm suspecting path_info is possibly broken.
Reverts 1.68, as suggested by Brian Havard.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91479 13f79535-47bb-0310-9956-ffa450edef68
This can happen if there is a partial match between a bad URI and a
file with a variant extention.
ap_sub_req_lookup_dirent has apparently been generating bogus subrequest
URIs for ages, but they used to be ignored. Once we started calling
ap_process_request_internal for all subrequests, they started causing
problems. Make it explicit that rnew->uri is to be ignored for this type
of subrequest.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91375 13f79535-47bb-0310-9956-ffa450edef68
activated. It may be bumpy for a few days, and we have more optimizations
to put in place, but it's time to get this in the developer's test code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91359 13f79535-47bb-0310-9956-ffa450edef68
I ended up blasting these (intentional) changes as well :(
This finishes up the changes for the new, replacement ap_directory_walk
for testing. This code isn't active yet.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91342 13f79535-47bb-0310-9956-ffa450edef68
doesn't activate that code, I will do so probably by Monday, after more
thorough testing.
Introduces the ap_directory_walk::cache so we can stop wasting tons of
effort in mod_autoindex and other subreq/redirect requests.
This isn't thoroughly tested, I've only stepped through a half dozen
common cases. If you want to play, define REPLACE_PATH_INFO_METHOD.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91340 13f79535-47bb-0310-9956-ffa450edef68
as the parent request. Also pulls a bunch of notes and code that was
set aside, we don't need this with the other optimizations introduced.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91254 13f79535-47bb-0310-9956-ffa450edef68
after deleting the EOS bucket.
This prevents a seg fault in mod_include when the connection dies. There
doesn't seem to be much point in passing empty brigades in general.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91225 13f79535-47bb-0310-9956-ffa450edef68
If we are *already* a faux URI (i.e. relative file sub req) and we then
make a subrequest from that faux URI to a file in the same directory,
we'd try to build a URI out of the fake URI which leads to the wrong
thing happening somewhere down the line. So, let's just give this
special case a fake URI as well.
OtherBill needs to verify this. He can back it out if he wants. I
don't much care. It's one line and it seems okay...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91187 13f79535-47bb-0310-9956-ffa450edef68
Eliminate URI-centric phases in ap_process_request_internal() for pure
file subrequests (that don't correspond to URI space.) translate_name
hook and location_walks are skipped for these requests.
Moves the reset of the per_dir_config out of directory_walk into the
internal request processing code, so that resources with alternate
map_to_storage requirements start with clean r->server->lookup_defaults.
Optimizes out the authn/authz of effectively identical subreqests and
redirects, as the sub_req_lookup calls once did. Unlike 1.3, we copy
r->user and r->ap_auth_type from main/prev for the request's reference.
Stop copying the subrequest's r->chunked flag (Rbb assured me it looked
bogus, chunking is on the parent request) and clean out other #if 0'ed
cruft we don't need to refer back to anymore.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91169 13f79535-47bb-0310-9956-ffa450edef68
ending to this filename-less request a bit later in the request cycle, to
give older, ported modules more time to cope without implementing
the map_to_storage hook.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91131 13f79535-47bb-0310-9956-ffa450edef68
caller -- ap_process_request_internal() -- catches that and returns
OK to its caller -- ap_process_request(). But ap_process_request(),
seeing OK, tries to run a handler. It needs to skip that if the
request was completed in ap_process_request_internal().
Reviewed by: William A. Rowe, Jr.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91095 13f79535-47bb-0310-9956-ffa450edef68
on attempting a subreq/redirect or simply a second pass, and for each
match in series, if the section is a match, we reuse the merge result
for that section.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90925 13f79535-47bb-0310-9956-ffa450edef68
after any other map_to_storage operations.) Therefore, initialize any
NULL r->per_dir_config at this phase (the earliest necessary point.)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90868 13f79535-47bb-0310-9956-ffa450edef68
We hadn't prepared for this possibility that someone didn't set up the
r->per_dir_config (which the subreq's didn't). Since we are first in
line, we will handle it if need be.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90865 13f79535-47bb-0310-9956-ffa450edef68
----------------------------------------------------
if the base paths are the same
if (strncmp(rnew->filename, fdir, fdirlen) == 0
and there's more stuff in the new filename than just the base path
&& rnew->filename[fdirlen]
and that stuff contains no slashes
&& ap_strchr_c(rnew->filename + fdirlen, '/') == NULL)
----------------------------------------------------
Assuming that's a correct translation, which I believe to be the case
(and which also seems to jive with the previous version of the test),
then that first part darned well better check == 0, as opposed to != 0.
strncmp returns 0 when they match. =-)
And voila,
"All tests successful, 1 test skipped."
is the result from httpd-test
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90842 13f79535-47bb-0310-9956-ffa450edef68
from the primary request, redirects and sub-requests.
This will significantly reduce opporunities for inconsistancy (such
as Ian observed, and as I repaired only a month ago.)
This promotes process_request_internal to an ap_ namespace protected
entity in server/request.c (from it's old home in http/http_request.c)
since this fn has no http specifics.
Reviewed (in concept): Cliff Woolley, Ian Holsman
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90833 13f79535-47bb-0310-9956-ffa450edef68