1
0
mirror of https://github.com/apache/httpd.git synced 2025-06-07 20:02:05 +03:00

134 Commits

Author SHA1 Message Date
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
Jeff Trawick
edc450c8ac implement Ryan's suggested fix for buckets associated with a subrequest
having private data in the wrong (i.e., subrequest) pool, leading to
a segfault later in processing the main request

in the patch posted on new-httpd, the temporary brigade was allocated from
the connection pool; the committed code allocates the brigade from the
main-request pool, as suggested by Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89284 13f79535-47bb-0310-9956-ffa450edef68
2001-06-07 01:24:44 +00:00
Jeff Trawick
dc3207f9bf nicer to compare r->finfo.filetype with APR_NOFILE instead of 0
the sub request output filter shouldn't lose the return code from
the next filter


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89275 13f79535-47bb-0310-9956-ffa450edef68
2001-06-06 12:51:21 +00:00
Doug MacEachern
44238d2266 change create_request hook to RUN_ALL/return int so handlers can throw errors
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88576 13f79535-47bb-0310-9956-ffa450edef68
2001-03-25 17:38:18 +00:00
Ryan Bloom
895b7b26ac Add a hook, create_request. This hook allows modules to modify
a request while it is being created.  This hook is called for all
request_rec's, main request, sub request, and internal redirect.
When this hook is called, the the r->main, r->prev, r->next
pointers have been set, so modules can determine what kind of
request this is.

Currently, this is only used by the core module, but protocol modules
are going to need to have the ability to affect the request while it is
being read.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88532 13f79535-47bb-0310-9956-ffa450edef68
2001-03-18 02:33:23 +00:00
Ryan Bloom
54ed3070d5 Another chunk of code from http to core. This should continue to build
on all platforms.  The next job is to shuffle functions back and forth
so that the server builds without mod_http.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88453 13f79535-47bb-0310-9956-ffa450edef68
2001-03-05 04:43:56 +00:00