1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

258 Commits

Author SHA1 Message Date
André Malo
8dd8543053 Rework of the recursion stopper - collapse recursion counters into one function
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100095 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 23:04:32 +00:00
André Malo
b2b035253f - revert my patch (r1.155) since it produces regressions.
- add a note to STATUS that we don't forget the thing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100086 13f79535-47bb-0310-9956-ffa450edef68
2003-05-29 15:07:12 +00:00
André Malo
1af02389bb Prevent the server from crashing when entering infinite loops. The
new LimitInternalRecursion directive configures limits of subsequent
internal redirects and nested subrequests, after which the request
will be aborted.
[William Rowe, Jeff Trawick, Andr� Malo]

PR: 19753 (and probably others)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99911 13f79535-47bb-0310-9956-ffa450edef68
2003-05-19 01:19:55 +00:00
André Malo
986cb6b961 Do not bypass output filters when redirecting subrequests internally.
PR: 17629


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99042 13f79535-47bb-0310-9956-ffa450edef68
2003-03-22 22:15:40 +00:00
Jeff Trawick
f03fc13861 Keep the subrequest filter in place when a subrequest is
redirected.

PR: 15423


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98778 13f79535-47bb-0310-9956-ffa450edef68
2003-02-24 00:57:40 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
Greg Ames
65b5ceef11 fix weird things that happen with canned error messages due to using two
different request_recs after an ErrorDocument internal redirect failure.
examples: wrong Content-Type, garbled output from ebcdic servers due to
double charset translation


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96364 13f79535-47bb-0310-9956-ffa450edef68
2002-08-13 14:27:39 +00:00
Justin Erenkrantz
32e15557ff Fix infinite loop when reading certain data due to two HTTP_IN filters being
present for internally redirected requests.

If HTTP_IN is present, r->proto_input_filters would have it, so adding it
twice is wrong.

PR: 10146
Reviewed by:	Brian Pane


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95895 13f79535-47bb-0310-9956-ffa450edef68
2002-06-27 04:40:47 +00:00
Justin Erenkrantz
001b387bcd Change conn_rec->keepalive to an enumerated value of
AP_CONN_UNKNOWN
AP_CONN_CLOSE
AP_CONN_KEEPALIVE

This also fixes a problem where ap_discard_request_body would not discard
the body when keepalive was 0.  This actually meant the keepalive status
was unknown *not* closed, but no one ever remembered that.

This problem was seen with mod_dav sending error responses (as reported by
Karl Fogel).

Suggested by:	Greg "this isn't the '80s" Stein
Reviewed by:	Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95891 13f79535-47bb-0310-9956-ffa450edef68
2002-06-26 19:45:07 +00:00
Greg Ames
38de4bc46f ap_die: get rid of bad side effects from the recursive error handling code
that mess with the status and which request_rec the rest of the function uses.

Submitted by:  Justin Erenkrantz, Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95834 13f79535-47bb-0310-9956-ffa450edef68
2002-06-21 13:58:39 +00:00
Greg Ames
54b431dfb6 prevent infinite recursion if an ErrorDocument gets an error
Reported by: Colm MacC�rthaigh <colmmacc@Redbrick.DCU.IE>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95825 13f79535-47bb-0310-9956-ffa450edef68
2002-06-20 19:34:28 +00:00
Cliff Woolley
969ce29888 detabify
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95598 13f79535-47bb-0310-9956-ffa450edef68
2002-06-10 22:02:57 +00:00
Ryan Bloom
a90a9ba2be Call ap_discard_request_body from ap_finalize_request. Remove the call
from all other modules that do not use it to determine the response for
the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95576 13f79535-47bb-0310-9956-ffa450edef68
2002-06-07 22:31:34 +00:00
Justin Erenkrantz
0186760562 Fix the case where we generate both a 401 and 413 and we go bonkers.
- If an error would drop the connection, we do not return the top-level
  error anymore as we will assume this new one takes precedence over the
  original error.  This also ensures that we will not read the input
  body (which is the point of returning these special error messages in
  the first place).
- The ap_discard_request_body return value in ap_die() must be checked
  to make sure we don't encounter this recursive case and print two errors.

Kudos to Jeff Trawick for his sample input which pointed this out.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95426 13f79535-47bb-0310-9956-ffa450edef68
2002-05-31 07:37:19 +00:00
Justin Erenkrantz
6d8dd592a5 Correctly return 413 when an invalid chunk size is given on input.
- If get_chunk_size() returns a negative number, that probably implies
  an overflow.  So, create a 413 error and pass it to the output filters.
- Modify ap_discard_request_body() to return OK quickly if we're a subreq
  or our status code implies that we will be dropping the connection.
- Modify ap_die() so that if the new status implies that we will drop
  the connection, that we correctly indicate that we can not keepalive
  this connection.  (Without this, the error is returned, but the connection
  is not closed.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95331 13f79535-47bb-0310-9956-ffa450edef68
2002-05-28 23:38:31 +00:00
Jeff Trawick
bc0cf18899 stop using APLOG_NOERRNO in calls to ap_log_[pr]error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95151 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:33:10 +00:00
Brian Pane
4c04f98079 Replaced a sprintf("%d") with itoa
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94856 13f79535-47bb-0310-9956-ffa450edef68
2002-04-29 08:05:37 +00:00
Justin Erenkrantz
d8b443e424 If a subreq added a filter (say INCLUDES) and the subreq was promoted via
fast_redirect, the filter would still point at the subreq - rather than
the original r.  So, we must update any filters pointing at rr to be r.

This would cause lots of problems with mod_include with mod_dir requests
such as seen in PR 7966.  mod_include would be unsetting the headers_out
of rr instead of r.  But, we disassociate rr->headers_out and r->headers_out.
Therefore, the C-L header in r->headers_out would remain - even though it
bears no relation to what we will be outputting - causing problems.

This also now permits chunked-encoding of mod_dir/mod_include requests
which could never happen before and fixes the content-length problem
seen in PR 7966.

As hinted at in PR 7966, there is a race condition - if for some reason
the server stalls reading an included file (or even better, placing a
sleep in the cgi-bin script!), the invalid C-L may get propogated to the
client.

(Note that internal_internal_redirect has this same code fragment.)

PR: 7966


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94832 13f79535-47bb-0310-9956-ffa450edef68
2002-04-28 06:41:35 +00:00
Justin Erenkrantz
4d16513418 Fix subreqs with non-defined Content-Types being served improperly.
If we do not know a C-T for a subreq, we *must* propogate that
non-knowledge upwards to the main request.

Previously, if you used a DirectoryIndex with a file without a C-T (say
.shtml without AddType), the r->content_type will be kept as
httpd/unix-directory when we promoted the subreq in mod_dir.  Since there
would be no handler on this file, ap_invoke_handler (config.c:355) would
set the handler to be httpd/unix-directory (which was the old C-T of the
dir).  This would then trigger the handler to become httpd/unix-directory.
mod_autoindex would then try to serve the request.  But, the filename
was propogated upwards by mod_dir's DirectoryIndex via
internal_fast_redirect - it would then return a 403 trying to generate a
mod_autoindex page for a file.

Now, we will use ap_default_type() which is correct.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94676 13f79535-47bb-0310-9956-ffa450edef68
2002-04-17 04:09:07 +00:00
Ryan Bloom
c3d4e4787a Fix a segfault. Only try to set this if the sub_Request has a c-t.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94471 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 21:24:13 +00:00
Ryan Bloom
b18ca18f8d If we are doing a fast_redirect, and we don't have a main request, then
make sure that we don't have the sub_req_output_filter.  This was
causing problems when there were multiple sub_Requests, and some should
have had the filter, but the last one shouldn't.

This fixes the final known bug in 2.0.35


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94470 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 21:16:11 +00:00
William A. Rowe Jr
41354689f4 Clean up breakage introduced recently that sent the wrong headers through
the http_headers output filter.  Now we will always point every filter at
  the 'redirected' request, e.g. the actual error message response rather
  than the request that failed.

Reviewed by: JimJag, Rbb, DougM


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94467 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 20:06:52 +00:00
Ryan Bloom
f25b712539 This fixes the mod_autoindex problem of not getting the list of files.
The problem was that the internal_fast_redirect removed the SUB_REQ
filter, but we are still in a sub_request.  The solution is to have the
fast_internal_Redirect function check if we are in a sub_Request and
re-add the filter if we are.
Submitted by:	Ryan Bloom, Greg Ames, Jeff Trawick, and Will Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94456 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 17:43:03 +00:00
Cliff Woolley
3e2ce19baf BUCKET FREELISTS
Add an allocator-passing mechanism throughout the bucket brigades API.

From Apache's standpoint, the apr_bucket_alloc_t* used throughout a given
connection is stored in the conn_rec by the create_connection hook.  That
means it's the MPM's job to optimize recycling of apr_bucket_alloc_t's --
the MPM must ensure that no two threads can ever use the same one at the
same time, for instance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94304 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 08:17:26 +00:00
Bill Stoddard
7da34b011d Add a new parameter to the quick_handler hook to instruct
quick handlers to optionally do a lookup rather than actually
serve content. This is the first of several changes required fix
several problems with how quick handlers work with subrequests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94240 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 22:42:16 +00:00
Bill Stoddard
d5c24720dc Commit 1 of 2 to:
1. rename ap_rset_content_type to ap_set_content_type
2. reverse the arguments on the call to aligh with ap_set_content_length


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94056 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 17:41:55 +00:00
Bill Stoddard
470edb9dd8 First commit to introduce accessor function to set r->content_type..
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94027 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 01:58:47 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Bill Stoddard
6752a95e45 Move the quick_handler comment to the new quick handler location. Do not
call quick handler on a dirent subrequest. This fixes a nasty problem in
mod_cache where it was serving up content on a dirent subrequest.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93915 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 19:41:56 +00:00
Ryan Bloom
17085db8d6 Remove a comment that no longer applies.
Submitted by:  Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93725 13f79535-47bb-0310-9956-ffa450edef68
2002-03-06 14:43:45 +00:00
Ryan Bloom
da5dd9c2b2 Remove another hack from the server. The add_required_filters function
was required to make sure that the sub request had the correct filters
when we went send the error page.  With the new filter insertion logic,
this is no longer necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93710 13f79535-47bb-0310-9956-ffa450edef68
2002-03-05 05:41:28 +00:00
William A. Rowe Jr
e86a858a20 Just formatting cleanup, nothing interesting here, move along :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93700 13f79535-47bb-0310-9956-ffa450edef68
2002-03-04 19:11:05 +00:00
Ryan Bloom
9ac46ee310 Fix the mod_dir/mod_negotiation bug, where redirects and sub requests
were not getting the correct filters.  This is done by creating a location
in the request rec that holds protocol level filters.  Protocol level
filters survive for one request, from the time the request is received
from the user to the time the response is sent.  r->output_filters now
stores the request level filters, which are only valid for the lifetime
of one request_rec.

This patch works, but it is not complete.  The second half of the problem
is that add_any_filter doesn't check where it puts the filters that it
adds, so it is possible for filters to be put on this wrong list, and
for filters to be lost completely during request processing.  That half
of the fix will be coming in the next day or so.

Submitted by:	Will Rowe, Justin Erenkrantz, Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93682 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 02:15:52 +00:00
Justin Erenkrantz
94d01b65aa Change ap_get_brigade prototype to remove *readbytes in favor of readbytes.
If you need the length, you should be using apr_brigade_length.  This is
much more consistent.  Of all the places that call ap_get_brigade, only
one (ap_http_filter) needs the length.  This makes it now possible to
pass constants down without assigning them to a temporary variable first.

Also:
- Change proxy_ftp to use EXHAUSTIVE mode (didn't catch its -1 before)
- Fix buglet in mod_ssl that would cause it to return too much data in
  some circumstances


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93014 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 01:11:47 +00:00
Justin Erenkrantz
7d32242a14 Input filtering prototype change: Socket blocking type should be
separate from the input filter mode type.

We also no longer look at readbytes to determine the method of
filter operation.  This makes the use of filters more obvious and
allows a wider range of options for input filters modes.

To start with, the new input filter modes are:

AP_MODE_READBYTES (no more than *readbytes returned)
AP_MODE_GETLINE (old *readbytes == 0 case)
AP_MODE_EATCRLF (old AP_MODE_PEEK)
AP_MODE_SPECULATIVE (will be used in a future ap_getline rewrite)
AP_MODE_EXHAUSTIVE (old *readbytes == -1 case)
AP_MODE_INIT (special case for NNTP over SSL)

The block parameter is an apr_read_type_e: APR_BLOCK_READ, APR_NONBLOCK_READ

This also allows cleanup of mod_ssl's handling in the getline case.

Reviewed by:	Ryan Bloom (concept), Greg Stein (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92928 13f79535-47bb-0310-9956-ffa450edef68
2002-01-19 07:45:18 +00:00
Ian Holsman
6dcd25894c quick handler now runs on subrequests as well
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92862 13f79535-47bb-0310-9956-ffa450edef68
2002-01-16 04:29:10 +00:00
William A. Rowe Jr
33eaba0f1e A style change for ken :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92470 13f79535-47bb-0310-9956-ffa450edef68
2001-12-14 03:29:13 +00:00
William A. Rowe Jr
cc843273b8 Ensure we include path_info in ap_internal_fast_redirect() for multiview
mapping.  This isn't the end of these bugs, only one puzzle piece.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92259 13f79535-47bb-0310-9956-ffa450edef68
2001-11-30 05:29:40 +00:00
Cliff Woolley
0caf1ce9db Fix a bug which would cause the response headers to be omitted
when sending a negotiated ErrorDocument because the required
filters were attached to the wrong request_rec.

Submitted by:	John Sterling <sterling@covalent.net>
Reviewed by:	Justin Erenkrantz, Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91900 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 07:37:13 +00:00
Justin Erenkrantz
24a8625ef6 This section of tabs in the middle of space-only bugs me.
Reformat this section.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91897 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 06:12:41 +00:00
Ian Holsman
eea38d7c2e This patch changes the apr_table_elts macro so that it provides
access to the internals of an apr_table_t via a const pointer
instead of the current non-const pointer.


Submitted by:	Brian Pane <BPane@pacbell.net>
Reviewed by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91860 13f79535-47bb-0310-9956-ffa450edef68
2001-11-11 22:31:04 +00:00
Greg Ames
da57dc70de make sure that the HTTP_IN filter is in place across internal redirects.
Without this, we see an extra socket read + timeout on POSTs.  If the client
sends in another request, we loop consuming memory.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91695 13f79535-47bb-0310-9956-ffa450edef68
2001-10-30 19:21:41 +00:00
William A. Rowe Jr
73fcb0b7af Goodbye r->content_lanaguage (per vote from apache-1.3/STATUS).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91244 13f79535-47bb-0310-9956-ffa450edef68
2001-10-02 21:13:42 +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
Justin Erenkrantz
cb8569e4f8 This patch eliminates the wasteful run-time conversion of method names from
strings to numbers in places where the methods are known at compile
time.

(Justin fixed the va_end() call to be correct.)

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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91078 13f79535-47bb-0310-9956-ffa450edef68
2001-09-19 05:52:42 +00:00
William A. Rowe Jr
76eef7ccce Now that stinks, sorry. In moving code - I didn't notice my code
now served out (r) info instead of the (rnew) info.  Made for nasty
  cyclic loops in mod_dir :(

  It looks like this works once again.  I'll post completed deltas to
  the list ASAP.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90838 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 03:49:42 +00:00
William A. Rowe Jr
d78dd20618 Much better - sorry - I missed one case of forcing pipeline flush when
the handler returned a non-OK result.  ergo, 304's weren't sent.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90837 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 02:46:29 +00:00
William A. Rowe Jr
96c3ce2961 After calling ap_process_request_internal(), the caller must invoke
the handler themselves.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90835 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 02:29:48 +00:00
William A. Rowe Jr
3db323656f 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@90832 13f79535-47bb-0310-9956-ffa450edef68
2001-08-31 01:38:06 +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