1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

205 Commits

Author SHA1 Message Date
William A. Rowe Jr
8e82ad3743 Split out (soon to be) common code for all _walk functions
(no net change to location_walk).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91185 13f79535-47bb-0310-9956-ffa450edef68
2001-09-28 18:56:21 +00:00
William A. Rowe Jr
6d273ef60f Overhaul the compatibility with 1.3's subrequest and redirect processing.
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
2001-09-28 04:46:37 +00:00
Jeff Trawick
42ac007cc6 fix a gcc warning -- "/* within a comment"
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91140 13f79535-47bb-0310-9956-ffa450edef68
2001-09-25 09:46:37 +00:00
William A. Rowe Jr
1eed4b273e Joy, joy. Relax the rules, just a wee bit, and prepare to move the fatal
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
2001-09-24 21:07:06 +00:00
Jeff Trawick
8b31569e09 Currently, when the map-to-storage handler for TRACE returns DONE, the
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
2001-09-20 17:54:51 +00:00
Ryan Bloom
1e90a12ab2 Fix a seg fault in mod_include. When we are generating an
internal redirect, we must set r->uri to "", not a bogus
string, and not NULL.  [Ryan Bloom]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90929 13f79535-47bb-0310-9956-ffa450edef68
2001-09-06 17:58:28 +00:00
William A. Rowe Jr
3c1228bf9d Optimize location_walk. We build an array of incremental matches, and
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
2001-09-06 16:48:15 +00:00
William A. Rowe Jr
b5108c6797 After some consideration - Location walk is always required (before and
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
2001-09-01 05:21:16 +00:00
William A. Rowe Jr
bc01f18d5d I love it when a plan comes together.
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
2001-09-01 02:38:18 +00:00
William A. Rowe Jr
640e927610 Ahhh, a const headache. Here's a flag that is writeable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90861 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 22:33:24 +00:00
William A. Rowe Jr
450f9a96dc Since we can preserve and further canonicalize the subreq_file name onto
a canonical r->filename, let's do so.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90860 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 22:29:28 +00:00
William A. Rowe Jr
a060632d51 Add some notes of things I noticed while proofing. We still need a
resolution to rnew->chunked = r->chunked in subrequests!


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90859 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 22:07:05 +00:00
Jeff Trawick
99fc2084a6 resolve_symlink() is only used if REPLACE_PATH_INFO_METHOD is
defined


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90846 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 10:58:47 +00:00
Cliff Woolley
7f6b8db678 As I understand it, this test is supposed to read like so:
----------------------------------------------------
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
2001-08-31 05:05:58 +00:00
William A. Rowe Jr
679e890efc Invoking the handler must occur at the caller's discression, in order
for the sub_req mechanism to share this code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90836 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 02:31:08 +00:00
William A. Rowe Jr
0dc1d9811c Move the ap_run_insert_filters to consistently occur in
ap_process_request_internal.  This allows the sub_req handler
  to alter the filters before the subreq is actually run.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90834 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 02:23:25 +00:00
William A. Rowe Jr
48a818a36f Normalize all paths to run the same, common code for pre-request setup
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
2001-08-31 01:50:15 +00:00
William A. Rowe Jr
7cec5457d7 The add-in/strip-off temporary trailing slash logic was really hosed
in the new (not yet enabled) code path.  Now it's slightly hosed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90829 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 23:58:23 +00:00
William A. Rowe Jr
515b1522d7 Fix the new code (not currently enabled) for directory_walk
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90823 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 20:48:06 +00:00
Jeff Trawick
066c3b0623 fix some calls to apr_pool_userdata_get()
(foo** just doesn't work the way we sometimes might want :( )


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90725 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 10:23:11 +00:00
William A. Rowe Jr
544cea832e Final additional comments (for the moment) about the new optimization.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90716 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 04:51:58 +00:00
William A. Rowe Jr
9c42239d68 Further optimization to location_walk() and clean up unused variables.
We will note the end result of the merge, and if remains the same through
  the second pass, we have nothing whatsoever to do :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90714 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 04:37:40 +00:00
William A. Rowe Jr
7d55e44913 Clean up location_walk, so that this step performs a minimum
amount of redundant effort (it must be run twice, but it will no
  longer reparse all <Location > blocks when the request uri
  hadn't changed.)

  The location walk block is refactored, with some significant changes
  in variable names for legibility.  Cooler still, it uses pool data
  instead of 'notes' for the important cache info :)

  Note the patch builds the <Location > per dir config from _nothing_,
  and then merges it into the per_dir_config.  When the underlying
  per_dir_config changes between passes, the location_walk can simply
  tack back on this preconstruct onto the new per_dir_config.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90713 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 04:29:09 +00:00
William A. Rowe Jr
7552c9cb16 Eliminate proxy: (and all other 'special') processing from the
ap_directory_walk() phase.  Modules that want to use special
  walk logic should refer to the mod_proxy map_to_location example,
  with it's proxy_walk and proxysection implementation.  This makes
  either directory_walk flavor much more legible, since that phase
  only runs against real <Directory > blocks.

  On a technical note, this patch also forces the Directory to be
  canonical (unless it is "/" or a regex.)  It also allows us to
  be more explicit when declaring <Directory > block errors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90684 13f79535-47bb-0310-9956-ffa450edef68
2001-08-26 05:10:17 +00:00
William A. Rowe Jr
307ab55886 Introduce the map_to_storage hook, which allows modules to bypass
the directory_walk and file_walk for non-file requests.  TRACE
  shortcut moved to http_protocol.c as APR_HOOK_MIDDLE, and the
  directory_walk/file_walk happen as APR_HOOK_VERY_LAST in core.c.

  A seperate patch to mod_proxy is required to short circuit both the
  TRACE and directory_walk/file_walk stuff.  That patch is next.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90665 13f79535-47bb-0310-9956-ffa450edef68
2001-08-25 23:43:19 +00:00
William A. Rowe Jr
bb757df043 sec, sec, who's got a sec? This gave me a headache, but I had to clear
out the last patch before I rearranged this to be _readable_.

  Next step for everyone's sanity, provide <Proxy > directives ;)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90646 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 18:12:02 +00:00
William A. Rowe Jr
6be8943643 Commit this code before another patch becomes to difficult to follow.
This patch does one thing, it changes the root path "/" to reflect an
  element count of Zero (0).  directory_walk will always accept the zero
  element (which sorts first, thankfully) on it's first go around.

  So, Unix will accept "/" when it's parsing it's first element "/".

  Dos/Win32 will accept "/" and "C:/" when they parse their first element,
  "C:/".  The root sorted first, so it behaves as users expect.

  The syntax "//" or "//machine" will be depreciated for now, the user
  needs to set up the extact "//machine/share/" that they want served
  on Win32.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90644 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 18:01:25 +00:00
William A. Rowe Jr
aa07a7d9e7 Whoops. To explain, we won't dup filename unless it really didn't match
in the first place.  We are about to abuse test_filename, so don't try
  using that copy.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90592 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 21:58:07 +00:00
William A. Rowe Jr
1a1e251ca8 Start with the presumption that canonical_filename is not likely to be set.
Therefore we will canonicalize it when it doesn't match filename.

  The next optimization should take the path common to canonical_filename
  and filename, and start merging filename from there for canonicalization.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90591 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 21:56:36 +00:00
William A. Rowe Jr
8944117f48 Another spot we are certain of the canonical_filename
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90590 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 21:21:17 +00:00
William A. Rowe Jr
1ffa5e572f Rather than continuing to canonicalize within directory_walk (very time
consuming on all but *nix systems) we temporarily canonicalize to compare
  the results of the many merges, and fail on a mismatch.

  The apr_filepath_merge and ap_server_root_relative calls now merge the
  file _by canonicalizing it_.  That includes resolving all /../, /./,
  and // misnomers.

  A minor effort is required to figure out who all munges the r->filename
  in an inappropriate manner.

  The final (return to optimized state) probably involves setting an
  r->goodname argument to r->filename, every time we properly merge
  through ap_server_root_relative or apr_filepath_merge().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90573 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 19:19:52 +00:00
Jeff Trawick
c216c2184a fix some homophonic issues in comments, as well as some
mispelings found near "its" or "it's"

(helping our 4th grader with homework, couldn't help but
grep)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90173 13f79535-47bb-0310-9956-ffa450edef68
2001-08-15 21:11:59 +00:00
Ryan Bloom
6e932b2870 Fix the new method code. We need to cast 1 to an apr_int64_t or it will
be treated as a 32-bit integer, and it will wrap after being shifted
32 times.
Submitted by:	Cody Sherr <csherr@covalent.net> and
		Ryan Morgan <rmorgan@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90090 13f79535-47bb-0310-9956-ffa450edef68
2001-08-11 04:04:13 +00:00
Cliff Woolley
00b50aade9 Fix a segfault (was getting triggered by mod_include at least) caused
by calling ap_allow_options() before setting rnew->per_dir_config.

This is the "easy looking" fix but might have side effects of which I'm
unaware... please double-check this change for correctness.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89978 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 02:34:42 +00:00
William A. Rowe Jr
c2c43f7a9f This was entirely broken. We cannot skip the location walk just because
we are in a file subrequest (think of a file server-status sitting in
  the document root, this shouldn't be blindly served as a 'file'.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89934 13f79535-47bb-0310-9956-ffa450edef68
2001-08-06 05:26:37 +00:00
William A. Rowe Jr
4e62141810 Just a little cleaner.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89933 13f79535-47bb-0310-9956-ffa450edef68
2001-08-06 05:07:34 +00:00
William A. Rowe Jr
f7e1f07bb3 More explanation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89931 13f79535-47bb-0310-9956-ffa450edef68
2001-08-06 02:27:26 +00:00
Jeff Trawick
78b3feb4ce fix some warnings in resolve_symlink(), one of which seems to be for
a genuine bug...

The old logic

  if (!(opts & OPT_SYM_OWNER | OPT_SYM_LINKS))

wouldn't seem to work properly.  I think it would act like

  if (!((opts & OPT_SYM_OWNER) | OPT_SYM_LINKS))

This clearly isn't intended since OPT_SYM_LINKS is a constant non-zero, such
that we never really fail invalid parameters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89860 13f79535-47bb-0310-9956-ffa450edef68
2001-08-01 11:59:55 +00:00
William A. Rowe Jr
bfa5e8539f Replace check_symlinks in the ap_sub_req_lookup_* calls with
the new resolve_symlink (also used by the new directory_walk)
  especially for performance and readability.  Left check_symlinks
  in the soon-to-be-gone get_path_info flavor of directory_walk.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89856 13f79535-47bb-0310-9956-ffa450edef68
2001-08-01 06:12:37 +00:00
William A. Rowe Jr
9d72a63ff7 Add the new directory_walk logic, eliminating get_path_info and
check_symlinks, in a protected define REPLACE_PATH_INFO_METHOD.

  This allows others to work on vetting, caching, etc, while keeping
  the existing logic stable till it's sufficiently optimal for beta.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89847 13f79535-47bb-0310-9956-ffa450edef68
2001-08-01 01:58:24 +00:00
William A. Rowe Jr
d35d3ecfab Use d_is_absolute within directory_walk.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89792 13f79535-47bb-0310-9956-ffa450edef68
2001-07-30 19:19:35 +00:00
William A. Rowe Jr
e9710c17ca Testing reveals a nasty side effect of this aftn's patch, this is the fix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89450 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 23:18:30 +00:00
William A. Rowe Jr
d4c82f83ea Pull harry, difficult to read sub_req_common_validation() into its own
function so that it's apparent that this is common code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89447 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 21:48:53 +00:00
William A. Rowe Jr
a7a28bd8c0 Here, finally are a few cleanups of my fat fingers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89444 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 20:57:14 +00:00
William A. Rowe Jr
07f1f1f5ea Now, introduce ap_sub_req_lookup_dirent() for processing apr_finfo_t
results from mod_negotiation and mod_autoindex.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89443 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 20:53:36 +00:00
William A. Rowe Jr
449207bd36 Pull the common cruft from ap_sub_req_lookup_*() fns.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89442 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 20:46:52 +00:00
William A. Rowe Jr
e3a7a230e7 Sorry, second pass, working on legibility. This patch introduces the
fill_in_sub_req_vars function to propogate the rnew values, but doesn't
  yet hook it in.  Note that there are two discrepancies, apparently
  pretty bad ones, that have been moved after the 'common code' so the
  next patch becomes pretty simple.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89441 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 20:44:00 +00:00
William A. Rowe Jr
ec222e4248 Revert changes in 1.7, I had applied the patch incorrectly.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89439 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 20:30:49 +00:00
William A. Rowe Jr
8ba66cccaf Move duplicated rnew cloning from apr_ap_sub_req_lookup_*() functions,
and add an ap_sub_req_lookup_dirent() to create a subrequest from the
  results of an apr_dir_read() for mod_negotiation and mod_autoindex.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89437 13f79535-47bb-0310-9956-ffa450edef68
2001-06-27 20:09:24 +00:00
Jeff Trawick
7d9292f971 back out bogus "fix" for subrequest buckets using wrong pool
Submitted by: Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89286 13f79535-47bb-0310-9956-ffa450edef68
2001-06-07 03:02:03 +00:00