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

285 Commits

Author SHA1 Message Date
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
Ryan Bloom
4db278ffc8 Make the default_handler catch all requests that aren't served by
another handler.  This also gets us to return a 404 if a directory
is requested, there is no DirectoryIndex, and mod_autoindex isn't
loaded.

PR:	8045
Submitted by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95690 13f79535-47bb-0310-9956-ffa450edef68
2002-06-15 05:49:06 +00:00
William A. Rowe Jr
7af68c0bf5 Solve the 80/20 by initializing and storing server_rec->timeout and
server_rec->keep_alive_timeout in apr_time_interval_t format (in apr
  units, whatever they be), as both values exist to pass into APR, and
  all APR timeouts are in apr_time_t.

Reviewed by:	Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95623 13f79535-47bb-0310-9956-ffa450edef68
2002-06-12 23:59:31 +00:00
Ryan Bloom
ca5fd7fb7b The apr_bucket change requires a minor MMN bump. Also modify Apache's
filters to use APR_BUCKET_IS_METADATA macro.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95454 13f79535-47bb-0310-9956-ffa450edef68
2002-05-31 20:52:28 +00:00
William A. Rowe Jr
4f93d4762c Resolve the EXEC_ON_READ bit for ServerRoot and other modules that test
the directive context.  Should eliminate the segfault.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95171 13f79535-47bb-0310-9956-ffa450edef68
2002-05-18 17:22:23 +00:00
William A. Rowe Jr
d9f47b5bc4 Although it appears reasonable to immediately gather the Error log and
level from the config; these are per-vhost entities that can't be
  processed as we preload the config tree.  There is more work to do,
  as Cliff Woolley guesses, before we can make this change.
  In the meantime, -e and -E should provide the admin sufficient options
  to work around problematic configs.  So I'm reverting those changes,
  for now.

  ServerRoot is global only, and it MUST be read immediately, so that
  part of the last patch stays.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95170 13f79535-47bb-0310-9956-ffa450edef68
2002-05-18 16:35:57 +00:00
Cliff Woolley
81c03e82c4 Renames:
APR_XtOffset   -> APR_OFFSET
  APR_XtOffsetOf -> APR_OFFSETOF


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95164 13f79535-47bb-0310-9956-ffa450edef68
2002-05-18 04:13:13 +00:00
William A. Rowe Jr
eb3ac00c5f We need to grab ServerRoot, LogLevel, and ErrorLog right off the bat
as we are reading the config.

  This closes a bug where ServerRoot /foo + LoadModule relative/mod_foo.so
  won't load mod_foo.so.

Reported by: Ron Leung <rleung@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95160 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 19:34:52 +00:00
Jeff Trawick
c871b41d3c stop using APLOG_NOERRNO in calls to ap_log_?error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95149 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:11:39 +00:00
Brian Pane
d74c4014cc Added EnableMMAP directive to allow the server administrator to
prevent mmap of file buckets upon read.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95040 13f79535-47bb-0310-9956-ffa450edef68
2002-05-11 23:24:29 +00:00
Brian Pane
bc90009198 Moved ap_setup_make_content_type() declaration to http_protocol.h
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95031 13f79535-47bb-0310-9956-ffa450edef68
2002-05-10 15:08:59 +00:00
Brian Pane
7e2c4f3a54 Performance fix: replaced the strcasecmp calls in ap_make_content_type()
with apr_strmatch()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95026 13f79535-47bb-0310-9956-ffa450edef68
2002-05-10 06:47:13 +00:00
Greg Ames
4c4ea8b348 default_handler: move the code to handle unusual methods out of the middle
of the hot path without using goto.

suggested by: Roy Fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94882 13f79535-47bb-0310-9956-ffa450edef68
2002-04-30 20:12:26 +00:00
Greg Ames
e5234ec416 remove a goto
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94807 13f79535-47bb-0310-9956-ffa450edef68
2002-04-25 20:51:49 +00:00
Greg Ames
6b40ae2b48 default_handler: short circuit the method checks. Move the code to deal
with unusual methods to the end of function to reduce i-cache clutter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94781 13f79535-47bb-0310-9956-ffa450edef68
2002-04-24 14:31:28 +00:00
Cliff Woolley
768d65eeac AcceptPathInfo was totally backwards... it would reject when set to on and
by default and accept when set to off for the default handler, and would
reject only if set to accept for mod_cgi(d) and mod_isapi.

PR: 8234


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94751 13f79535-47bb-0310-9956-ffa450edef68
2002-04-22 08:08:38 +00:00
William A. Rowe Jr
e5200732d3 Correct partitioning of filter handles between core and http, and
export the handle pointers on Win32.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94468 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 20:55:00 +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
Ryan Bloom
f44773343a We have to return valid HTTP status codes from filters. This fixes two
cases in the core_output_filters where there was a problem, and the core
returned an error code instead of an HTTP status code.  This keeps us from
putting status codes like 32 and 104 in the access log.

Submitted by:	Ryan Morgan <rmorgan@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94143 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 21:45:44 +00:00
Jim Jagielski
730e99e461 Fold the compiled-in knowledge of the allowable AcceptMutex settings into
its help entry. Requires the use of a extern string rather than a function
call for the initialization to be valid in the macro (Thx to Jeff!).
In the meantime, bump down the error logging until we deal with true
default and configured setting information ala 1.3.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94062 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 22:19:11 +00:00
Bill Stoddard
76bef9981f Commit 2 of 2 to:
1. rename ap_rset_content_type to ap_set_content_type
2. reverse the arguments to aligh with ap_set_content_length


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94057 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 17:44:13 +00:00
Bill Stoddard
e9ec908a01 Final commit to add ap_rset_content_type accessor. Add AddOutputFiltersbyType
filters during call to ap_rset_content_type()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94028 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 02:05:43 +00:00
William A. Rowe Jr
65a37752ec Eliminate potential ap_server_root_relative segfaults, with the input
of Jeff Trawick's style changes to the first patches.  Doesn't include
  the fixes to ssl [more complex], and we won't trap errors that involve
  ap_serverroot, since we presume that was normalized on the way in.
  Therefore, testing ap_server_root_relative(DEFAULT_FOO) cases
  should never become necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93965 13f79535-47bb-0310-9956-ffa450edef68
2002-03-16 18:26:58 +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
Justin Erenkrantz
3058b601ff As hinted on dev@httpd, change filter naming schemes to match our
expectations of their usage.

The reason that we should make this change now is that we have changed
the implied meaning of AP_FTYPE_HTTP_HEADER - some users of this should
be PROTOCOL while others should be CONTENT_SET.  In order to clarify it,
toss all of the bogus names and force the filter writers to make sure
they understand what they are doing.

CONTENT_SET is new (horrible name - change if you have better idea), but
it indicates that it should run between RESOURCE and PROTOCOL.
mod_deflate is the ideal CONTENT_SET filter.

The changed type names are:
CONTENT is now RESOURCE.
HTTP_HEADER is now PROTOCOL.  However, most filters that used HTTP_HEADER
may want CONTENT_SET.  (Only things like POP and HTTP belong as PROTOCOL.)

MMN bump since all filters need to be recompiled due to filter reordering.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93756 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 09:27:17 +00:00
Ryan Bloom
116497445f Remove the prev pointer from the filter chain. This removes
the complexity of trying to set the filter chain correctly, with the
side-effect of forcing us to walk the entire chain whenever we add
a filter.  Since the filter chains are small, the decrease in
complexity is worth it.
Reviewed by:	Allan Edwards


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93745 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 02:09:30 +00:00
Aaron Bannert
fce3fb4470 Fix a bug in the APR_MODE_EXHAUSTIVE mode for the core input filter.
This patch changes nothing outside of that mode.

Also, why do we ever call apr_brigade_length() in the core? This doesn't
seem right to me, so here's a comment above the other call.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93736 13f79535-47bb-0310-9956-ffa450edef68
2002-03-06 18:03:19 +00:00
Ian Holsman
17cc70b4ab Sander's Stylistic Submission
(de-tab)
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93717 13f79535-47bb-0310-9956-ffa450edef68
2002-03-05 20:43:24 +00:00
Greg Ames
4cdf0a67bb fix <Directory ~ blah> containers.
also, eradicate a few nefarious tabs which were found lurking in the vicinity.

Submitted by:  Rob Simonson <simo@us.ibm.com>
Reviewed by:   Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93711 13f79535-47bb-0310-9956-ffa450edef68
2002-03-05 15:46:21 +00:00
Ryan Bloom
349a0b17e4 Only insert net_filter once per request. Initialize the output
protocol filters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93709 13f79535-47bb-0310-9956-ffa450edef68
2002-03-05 05:24:21 +00:00
Justin Erenkrantz
d3c07a160b Ensure that net_time filter isn't added on subreqs - we assume that it is
added on !r->main requests.  This led to infinite loop/SEGV when dealing
with anything that created a subreq.

(I don't think core_create_req is a good place for adding this filter.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93694 13f79535-47bb-0310-9956-ffa450edef68
2002-03-04 09:20:03 +00:00
Ryan Bloom
633f3112fe Classify some of the input filters as the correct types. Previous to
this patch, the type wasn't too important, because all filters were
put on the same list.  After this patch, the filter type is very important,
because there are three different types of filters, and they are all treated
differently, namely:

CONNECTION:	Filters of this type are valid for the lifetime of this
		connection.
PROTOCOL:	Filters of this type are valid for the lifetime of this
		request from the point of view of the client, this means
		that the request is valid from the time that the request
		is sent until the time that the response is received.
CONTENT:	Filters of this type are valid for the time that this
		content is used to satisfy a request.  For simple requests,
		this is identical to PROTOCOL, but internal redirects
		and sub-requests can change the content without ending
		the request.

It is important to realize that the three major types above are actually
broken down into smaller groups in the code, to ensure that the ordering
of filters is always correct.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93688 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 22:34:55 +00:00
Justin Erenkrantz
0e17f7f2fa Fix segfault if content_type is NULL.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93570 13f79535-47bb-0310-9956-ffa450edef68
2002-02-26 04:04:54 +00:00
Ryan Bloom
b98728f920 I learned about AP_MODE_EXHAUSTIVE while reading some of the new filter
code earlier today.  With this mode, the Perchild MPM can finally be
fixed to work with filters.  I have changed a comment in the core to make
it clear that this mode is required, but I have mentioned how dangerous
this mode is.  Also add a comment to STATUS about my plans.

Hopefully I'll have some time this week to hack through the MPM.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93565 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 06:54:40 +00:00
William A. Rowe Jr
0d146565b9 This code should be a noop today. But I did not feel comfortable about
reusing/recopying each bucket -after- inserting it into the brigade.
  Also, copying bucket c from b from a seemed obtuse.

  This patch creates the single bucket, makes a copy of it for each
  sendfile chunk we are about to add to the brigade, and finally consumes
  that initial bucket as the final file bucket of the brigade.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93534 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 17:20:26 +00:00
William A. Rowe Jr
a6ceb1511a Fix the close-on-sendfile bug where Win32 would transmit a single
sendfile bucket and then lose it's socket, and fix a comment.

Submitted by:  Ryan Morgan <rmorgan@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93524 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 02:19:39 +00:00
Justin Erenkrantz
6700fa91fb Introduce AddOutputFilterByType directive.
AddOutputFilterByType DEFLATE text/html

(I will add docco soon, I promise.  If someone beats me to it, cool...)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93490 13f79535-47bb-0310-9956-ffa450edef68
2002-02-19 04:45:53 +00:00
Jeff Trawick
6ff14b1939 stop using APR_BRIGADE_NORMALIZE()
(okay, making a copy of it is cheating perhaps, but the name of the
game is to get APR_BRIGADE_NORMALIZE() out of the API)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93458 13f79535-47bb-0310-9956-ffa450edef68
2002-02-17 19:21:31 +00:00
Ryan Bloom
24ebef4e2d Be a bit more sane with regard to CanonicalNames. If the user has
specified they want to use the CanonicalName, but they have not
configured a port with the ServerName, then use the same port that
the original request used.

Submitted by:   Ryan Bloom and Ken Coar


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93296 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 16:58:37 +00:00
Jeff Trawick
7b393b84fe yet another tweak to empty brigade checking on entry to core_input_filter():
since APR_BRIGADE_EMPTY() assumes a non-empty brigade, we have to check
  before invoking that macro

  since APR_BRIGADE_EMPTY() can make a brigade empty, we have to check
  after invoking that macro

An obvious variation of this fix would be to change APR_BRIGADE_NORMALIZE()
to deal with empty brigades.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93293 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 16:16:55 +00:00
Justin Erenkrantz
85fabad5eb - Fix up a comment so that it makes more sense and explains why we return
APR_EOF instead of an EOS bucket.
- Start to try to be nice when we *know* we are EOS by removing the
  bucket.  This is only one case where we could end up with a 0 bucket
  in ctx->b, but let's remove it and move on.  (If the bucket were to
  return 0 bytes and still have data left to read on blocking mode,
  it's blantly broken, IMHO)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93270 13f79535-47bb-0310-9956-ffa450edef68
2002-02-06 02:24:18 +00:00
Jeff Trawick
6e73c4108a In core_input_filter, check for an empty brigade after
APR_BRIGADE_NORMALIZE().  Otherwise, we can get segfaults if a
client says it will post some data but we get FIN before any
data arrives.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93262 13f79535-47bb-0310-9956-ffa450edef68
2002-02-05 22:56:44 +00:00
Ryan Bloom
862f407872 Remove the install_transport_filters hook. The same function can be
acheived with the pre_connection hook.  I have added the socket to the
pre_connection phase to make this possible.
Reviewed by:	Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93259 13f79535-47bb-0310-9956-ffa450edef68
2002-02-05 22:18:49 +00:00
Bill Stoddard
bd3d360392 Reintroduce the create_connection hook. This hook is required to enable
modules to completely take over all network i/o from the core.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93171 13f79535-47bb-0310-9956-ffa450edef68
2002-02-01 22:16:31 +00:00
Bill Stoddard
afd601e6f5 Now how did this slip by. Fixes a segfault. I tested this code, really...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93091 13f79535-47bb-0310-9956-ffa450edef68
2002-01-30 01:57:53 +00:00
Bill Stoddard
4168820850 This patch restores most of Ryan's patch (11/12/2001) to remove the
client_socket from the conn_rec.  Diffs from Ryan's patch include:

- rename the create_connection hook to install_transport_filters
- move the point of invocation of the hook till after the call to
  after ap_update_vhost_given_ip to enable the hook to use vhost
  config info in its decision making.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93087 13f79535-47bb-0310-9956-ffa450edef68
2002-01-29 19:02:04 +00:00
Jeff Trawick
7522873058 Don't let the default handler try to serve a raw directory. At
best you get gibberish.  Much worse things can happen depending
on the OS.

This can happen when autoindex isn't loaded.

On AIX, I had a directory file which was reported to be 1536 bytes
in size.  mmap() failed so we went to the fall-back logic.
The first read() got 624 bytes and the next read() got 0
(supposedly EOF).  This confused us greatly, we kept allocating
buffers and reading and exercised the paging space.

Reviewed by:  Bill Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93071 13f79535-47bb-0310-9956-ffa450edef68
2002-01-29 04:54:05 +00:00
Bill Stoddard
327e4989d5 Remove the create_connection hook and put the client_socket back into the
conn_rec. The create_connection_hook has a design flaw that prevents it
from making decisions based on vhost information.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93050 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 12:52:08 +00:00
Brian Pane
196916cef1 Performance improvement: incorporated the use of the new
ap_add_input_filter_handle() and ap_add_output_filter_handle()
functions for core filters


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93040 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 02:13:10 +00:00
Jeff Trawick
753e0d77c6 avoid a palloc of zero bytes so memory debuggers don't barf
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93038 13f79535-47bb-0310-9956-ffa450edef68
2002-01-26 23:05:10 +00:00