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
c9e7a80335 . unwind MORE redundant code [wasn't I just here six months ago???]
. fix a redundant return [how no compilers caught a code-not-reachable
    is beyond me :]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92440 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 02:26:18 +00:00
Justin Erenkrantz
e5214bdf37 Style reformat. Tabs->spaces, etc, etc, etc.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92402 13f79535-47bb-0310-9956-ffa450edef68
2001-12-09 18:08:08 +00:00
Ben Laurie
56fcba71d3 Reduce magic levels.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92401 13f79535-47bb-0310-9956-ffa450edef68
2001-12-09 17:48:52 +00:00
William A. Rowe Jr
51c6b901bf Stat, don't lstat the final target. This means we may double-stat the
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
2001-11-09 16:54:00 +00:00
William A. Rowe Jr
026ed72a2a Reintroduce the 'one stat dir_walk', with singificantly more sensible
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
2001-11-09 08:08:42 +00:00
Justin Erenkrantz
439dcf6e68 This patch optimizes away some strlen and strcat calls in
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
2001-11-04 21:46:36 +00:00
Ken Coar
bb2a524c01 More style-stuff. A lot of this doesn't qualify as 'readable' even so.. :-(
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91721 13f79535-47bb-0310-9956-ffa450edef68
2001-11-01 20:14:16 +00:00
Ken Coar
957f5e40a3 Some style-guide fixes (nothing functional)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91719 13f79535-47bb-0310-9956-ffa450edef68
2001-11-01 16:06:21 +00:00
William A. Rowe Jr
da3ae7591e Use the _setn flavor which will avoid strdup'ing these strings, and
skip the cleanups we don't need.

Submitted by: Brian Pane <bpane@pacbell.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91681 13f79535-47bb-0310-9956-ffa450edef68
2001-10-29 15:19:03 +00:00
Justin Erenkrantz
456b51f0d5 Oh, don't you love buffer overflows?
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
2001-10-20 18:27:15 +00:00
Greg Ames
47ec77ab30 recognize filename subrequests without requiring a null URI. This fixes
a problem with infinite recursion of dirent subrequests.

Submitted by:  Bill Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91525 13f79535-47bb-0310-9956-ffa450edef68
2001-10-17 15:12:13 +00:00
William A. Rowe Jr
5e3b2442bf Fix the little bits o' breakage I introduced with the last two
'theoretical' corrections.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91482 13f79535-47bb-0310-9956-ffa450edef68
2001-10-16 02:23:42 +00:00
William A. Rowe Jr
75ed984cc7 directory_walk trounced existing path_info declarations. I suspect _this_
was Greg Ames bug...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91481 13f79535-47bb-0310-9956-ffa450edef68
2001-10-16 02:19:42 +00:00
William A. Rowe Jr
940a7786c7 Streamline this function, and append the trailing slash for any directories
that are resolved.  Needs to be more tightly coupled to the dir_walk
  optimized cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91480 13f79535-47bb-0310-9956-ffa450edef68
2001-10-16 02:15:45 +00:00
William A. Rowe Jr
317c6358d8 This will probably fix recent breakage to mod_negotation and httpd.test,
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
2001-10-16 01:57:45 +00:00
William A. Rowe Jr
f1f8494552 Always helps to add the member
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91380 13f79535-47bb-0310-9956-ffa450edef68
2001-10-09 03:15:05 +00:00
William A. Rowe Jr
9f1c799241 Speed it up. While this optimization wasn't obvious for the two-pass
location_walk, it is significant for all subreq/redirects reusing the
  cached walk values.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91378 13f79535-47bb-0310-9956-ffa450edef68
2001-10-09 02:41:47 +00:00
Greg Ames
8dd598a71f prevent near infinite subrequest recursion with mod_negotiation enabled.
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
2001-10-09 01:33:48 +00:00
Greg Ames
9213036eae get symlinks working again
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91371 13f79535-47bb-0310-9956-ffa450edef68
2001-10-08 22:07:32 +00:00
Jeff Trawick
b13cb7715c at least *this* cast keeps gcc happy (and should keep
everything else happy as well)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91368 13f79535-47bb-0310-9956-ffa450edef68
2001-10-08 21:13:51 +00:00
William A. Rowe Jr
e04108cee2 Revamped ap_directory_walk logic, without a path_info helper is now
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
2001-10-08 17:38:52 +00:00
William A. Rowe Jr
006f49d98a This is nothing but const bogosity. We have our very own manipulation,
we are allowed to touch the char *'s, even if we have a const contract.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91358 13f79535-47bb-0310-9956-ffa450edef68
2001-10-08 17:35:41 +00:00
William A. Rowe Jr
526abd74c0 Hmmm... continue's not so good an idea here :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91344 13f79535-47bb-0310-9956-ffa450edef68
2001-10-06 22:47:20 +00:00
William A. Rowe Jr
05cd8ac520 Aaargh! Unwinding part of my patch before I committed the prior version,
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
2001-10-06 22:16:11 +00:00
William A. Rowe Jr
2b9d60f5f5 A major overhaul to the -replacement- ap_directory_walk logic. This still
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
2001-10-06 21:52:29 +00:00
William A. Rowe Jr
e9efbadadb Correct file lookups when we are given a file within the same directory
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
2001-10-03 13:24:28 +00:00
Greg Ames
a119c52846 ap_sub_req_output_filter: don't pass along a brigade if it becomes empty
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
2001-10-01 21:01:14 +00:00
Justin Erenkrantz
d7a730adcf Fix for httpd-test modules/include test #17.
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
2001-09-29 06:54:08 +00:00
William A. Rowe Jr
e748927d17 Optimize file_walk with the same logic as location_walk. Fix both to
have a bit more legibility, and tighter locality of scope for a smaller
  number of variables.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91186 13f79535-47bb-0310-9956-ffa450edef68
2001-09-28 19:50:22 +00:00
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