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

405 Commits

Author SHA1 Message Date
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
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
Ian Holsman
9387a9974d These changes are to allow caching of subrequests via a quick_handler.
* Change SUBREQ_CORE so that it is a HTTP_HEADER (20) filter instead of a content filter (10)
  this allows subrequests to add content filters properly

* Change subreq handling of 'handle-include' so that it splits/passes the brigade before the subreq
  is created. (This allows quick_handler to push content back from this phase)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92956 13f79535-47bb-0310-9956-ffa450edef68
2002-01-21 01:43:30 +00:00
Justin Erenkrantz
29aec5a92c Make core_input_filter use the new apr_brigade_split_line function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92944 13f79535-47bb-0310-9956-ffa450edef68
2002-01-20 11:43:37 +00:00
Justin Erenkrantz
e39ae2098d Add AP_MODE_SPECULATIVE support to core_input_filter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92943 13f79535-47bb-0310-9956-ffa450edef68
2002-01-20 11:37:07 +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
Jeff Trawick
c42eed1493 Move a check for an empty brigade to the start of core input filter
to avoid segfaults.

Using prefork MPM and APR_POOL_DEBUG and ElectricFence, I found a
couple of paths where weren't able to report APR_EOF all the way
back up the call tree, leading us back into core_input_filter with
an empty brigade.

Some of the paths in core_input_filter handled it, some didn't.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92835 13f79535-47bb-0310-9956-ffa450edef68
2002-01-12 02:43:31 +00:00
Ken Coar
0d1a46028e Bring forward the FileETag directive enhancement from 1.3.23-dev.
(Passes all 61 of the apache/etags.t test.)  Bump MMN due to
	change to core_dir_config structure (new fields at end).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92830 13f79535-47bb-0310-9956-ffa450edef68
2002-01-11 18:55:27 +00:00
David Reid
bee20f4291 Restore the apr_pool_clear calls to main.c in case we have
third-parties who are overriding the open_logs hook, in which case
they'd miss the plog being cleared.

Submitted by:	Justin <jerenkrantz@apache.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92771 13f79535-47bb-0310-9956-ffa450edef68
2002-01-08 17:07:19 +00:00
David Reid
c229fe732d This small patch modifies the log's to use plog instead of pconf.
Basically pconf is cleared at different times from plog, and this
has the effect of leaving stderr closed when going into the next
stage of the config. This also had the effect of allowing FreeBSD
with threads to create a pipe with stderr's fd at one end, and this
resulted in problems with the signal polling and high cpu usage.

In addition, move the clearing of plog from main.c to core.c where
it seems more appropriate.

This solves the first and main problem that FreeBSD has with the
threaded MPM's.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92769 13f79535-47bb-0310-9956-ffa450edef68
2002-01-08 16:30:16 +00:00
Justin Erenkrantz
8c16aeeeb8 Fix LimitRequestBody directive by moving the relevant code from
ap_*_client_block to ap_http_filter (aka HTTP_IN).  This is the
only appropriate place for limit checking to occur (otherwise,
chunked input is not correctly limited).

Also changed the type of limit_req_body to apr_off_t to match the
other types inside of HTTP_IN.  Also made the strtol call for
limit_req_body a bit more robust.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92700 13f79535-47bb-0310-9956-ffa450edef68
2002-01-02 07:56:25 +00:00
Justin Erenkrantz
df91efdc0f Remove a needless immortal bucket creation. We can just leave the
brigade as-is.

Suggested by: Cliff


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92698 13f79535-47bb-0310-9956-ffa450edef68
2002-01-02 05:29:08 +00:00
Brian Pane
4d9b06444e Generalized the recent prep_walk_cache optimizations to allow other
modules to register "notes" within the array of working data in
the core_request_config


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92697 13f79535-47bb-0310-9956-ffa450edef68
2002-01-01 20:36:18 +00:00
Brian Pane
199e4864fc Performance fix for prep_walk_cache():
Moved the directory/location/file-walk caches from the
request's pool userdata hash table to the core_request_config
struct.

This change removes about 60% of the processing time from
prep_walk_cache().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92684 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 08:18:32 +00:00
Jeff Trawick
05ea6a3dcb avoid some ugly sockaddr comparisons in do_double_reverse() by using
apr_sockaddr_equal()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92620 13f79535-47bb-0310-9956-ffa450edef68
2001-12-27 13:28:42 +00:00
Jeff Trawick
187e9ae3b9 Change core code to allow an MPM to set hard thread/server
limits at startup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92512 13f79535-47bb-0310-9956-ffa450edef68
2001-12-18 13:48:54 +00:00
William A. Rowe Jr
a12371d10e Whoops, that's quadstate, the value 3 is not-present.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92460 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 19:44:45 +00:00
William A. Rowe Jr
97ff8a3f1f As suggested by Josh Slive, add the explicit 'default' to AcceptPathInfo.
I'll leave docs up to him.  The conf becomes a quadstate (undef != default)
  but other than that, it should make things cleaner for the user.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92459 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 19:13:23 +00:00
William A. Rowe Jr
6ca3e75ae0 If dconf->accept_path_info is tristate, why not r->used_path_info?
This patch allows us to force path_info off in mod_cgi[d] etc, patch
  forthcoming.  It also allows includes, php, etc to change the undefined
  value in the early handler or late fixup phases to Accept'ed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92448 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 16:11:41 +00:00
William A. Rowe Jr
eb97d00960 Now all should be well. AcceptPathInfo on will give us a document with
path_info served from the core handler.  Any filters can then manipulate
  all the usual CGI envvars [as proven with this little excerpt with a
  <!--#printenv --> document...

<FilesMatch ".*\.shtml.*">
    Options +Includes
    SetOutputFilter INCLUDES
    AcceptPathInfo on
</FilesMatch>

  a potentially questionable config, but effective.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92444 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 05:49:27 +00:00
William A. Rowe Jr
4c3f52cb75 Kill some redundancy (why test PUT when we disallow all but GET/POST?)
and add some thoughts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92441 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 02:35:31 +00:00
William A. Rowe Jr
d68c81274e Periods aren't commas. Clear out some inappropriate casts while
we are at it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92439 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 00:46:40 +00:00
William A. Rowe Jr
638854b09a Whatever this was doing, it looks most unholy.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92438 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 00:43:13 +00:00
Jeff Trawick
1cf0393871 don't lose the const-ness of the string being searched
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92353 13f79535-47bb-0310-9956-ffa450edef68
2001-12-06 02:54:47 +00:00
Brian Pane
a14848d128 Replaced ap_strcmp_match call that checked for a '/' in the
handler name with the equivalent (but less heavyweight)
strchr call


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92352 13f79535-47bb-0310-9956-ffa450edef68
2001-12-06 01:20:16 +00:00
Brian Pane
3eda1aaad8 Another performance-related change to core_output_filter(): if we
get a long stream of small buckets, so that multiple concatenation
steps are required in a single pass through the brigade, re-use the
buckets from the previous temp brigade when creating the next one.
This allows us to avoid making yet another copy of the previously
concatenated data.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92197 13f79535-47bb-0310-9956-ffa450edef68
2001-11-27 08:39:02 +00:00
Brian Pane
8ac8cb4842 Optimization for core_output_filter: if the iovec is full,
don't try to concatenate buffers if we already have at least
8KB of data ready to send.  Instead, just split the brigade
and send what's currently in the iovec.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92196 13f79535-47bb-0310-9956-ffa450edef68
2001-11-27 06:35:29 +00:00
Cliff Woolley
c32bd92a5b The survey says yes, that is in fact the expected behavior. :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92182 13f79535-47bb-0310-9956-ffa450edef68
2001-11-26 18:49:36 +00:00
Brian Pane
eb4b1ead89 Another fix for the core_output_filter() code that concatenates
small buckets: It's possible for the temporary brigade to
contain more than one bucket.  If this happens, we need to
recover the buckets after the first from the temporary brigade
before destroying it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92176 13f79535-47bb-0310-9956-ffa450edef68
2001-11-26 08:49:29 +00:00
Brian Pane
df871d8895 More fixes for core_input_filter()'s concatenation of small buckets:
update last_e and nbytes after compacting the brigade


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92174 13f79535-47bb-0310-9956-ffa450edef68
2001-11-26 07:21:48 +00:00
Brian Pane
a18f8fe052 Fix for the code in core_output_filter() that concatenates small buckets
into one big bucket...it was putting a pointer to a deleted bucket in
the iovec, so the output was corrupted.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92171 13f79535-47bb-0310-9956-ffa450edef68
2001-11-26 03:51:40 +00:00