mod_ext_filter.c

Checkout Tools
  • last updated 5 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
remove mod_ext_filter from experimental

  1. … 3 more files in changeset.

Submitted by: Paul J. Reder

Reviewed by: Jeff Trawick

Fixes required to get quoted and escaped command args working in

mod_ext_filter. There are also fixes in APR that were submitted

via a patch to apr_cpystrn.c PR 11793

  1. … 1 more file in changeset.
mod_ext_filter: Add the ability to enable or disable a filter via

an environment variable. Add the ability to register a filter of

type other than AP_FTYPE_RESOURCE.

  1. … 3 more files in changeset.
mod_ext_filter: Ignore any content-type parameters when checking if

the response should be filtered. Previously, "intype=text/html"

wouldn't match something like "text/html;charset=8859_1".

  1. … 1 more file in changeset.
mod_ext_filter: Set up environment variables for external programs.

Submitted by: Craig Sebenik <craig@netapp.com>

Reviewed by: Jeff Trawick

  1. … 3 more files in changeset.
Bring Apache in line with APR's new poll implementation. This isn't

optimal, because it still uses the compatibility functions to make it

work, but it does work. The next step will be to take the memory for

the pollsets under Apache's control.

  1. … 9 more files in changeset.
mod_ext_filter: don't segfault if content-type is not set.

PR: 10617

Submitted by: Arthur P. Smith <apsmith@aps.org>

Reviewed/modified by: Jeff Trawick

  1. … 1 more file in changeset.
Add a filter_init function to the filters so that a filter can execute

arbitrary code before the handlers are invoked.

This resolves an issue with incorrect 304s on If-Modified-Since mod_include

requests since ap_meets_conditions() is not aware that this is a dynamic

request and it is not possible to satisfy 304 for these requests (unless

xbithack full is on, of course). When mod_include runs as a filter, it is

too late to set any flag since the handler is responsible for calling

ap_meets_conditions(), which it should do before generating any data.

If a module doesn't need to run such arbitrary code, it can just pass NULL

as the argument and all is well.

PR: 9673

Reviewed by: Ryan Bloom and others

  1. … 17 more files in changeset.
Fix mod_ext_filter to look in the main server for filter definitions

when running in a vhost if the filter definition is not found in

the vhost.

PR: 10147

  1. … 1 more file in changeset.

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

  1. … 11 more files in changeset.
stop using APLOG_NOERRNO in calls to ap_log_[pr]error()

  1. … 33 more files in changeset.

Trade one signedness mismatch for another, but choose the one that is

known to be a positive value.

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.

  1. … 43 more files in changeset.
get the prototype for ap_set_content_type()

Use the accessor to set r->content_type

deal with the rename of kill_after_timeout to APR_KILL_AFTER_TIMEOUT

  1. … 6 more files in changeset.
Update our copyright for this year.

  1. … 260 more files in changeset.
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.

  1. … 16 more files in changeset.
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

  1. … 16 more files in changeset.
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)

  1. … 18 more files in changeset.

Fix a handful of AP_MODULE_DECLARE_DATA exports for .so modules.

  1. … 15 more files in changeset.
Remove all warnings from the input filtering stack.

  1. … 11 more files in changeset.
Back out the recent change to ap_get_brigade, to make it use indirection

again. The problem is that the amount of data read from the network,

is not necessarily the amount of data returned from the filters. It is

possible for input filters to add bytes to the data read from the network.

To fix the original bug, I just removed the line from ap_get_client_block

that decremented r->remaining, we allow the http_filter to do that for

us.

I have also removed an incorrect comment.

  1. … 13 more files in changeset.
Fix a bug in the input handling. ap_http_filter() was modifying *readbytes

which corresponded to r->remaining (in ap_get_client_block). However,

ap_get_client_block was *also* adjusting r->remaining. Net result was that

PUT (and probably POST) was broken. (at least on large inputs)

To fix it, I simply removed the indirection on "readbytes" for input

filters. There is no reason for them to return data (the brigade length is

the return length). This also simplifies a number of calls where people

needed to do &zero just to pass zero.

I also added a number of comments about operations and where things could be

improved, or are (semi) broken.

  1. … 11 more files in changeset.
At the hack-athon we decided to change the way that input filters

determine how much data is returned to the previous filter. Prior to this

change, we used a field in the conn_rec to determine how much to return.

After this change, we use an argument to ap_get_brigade. This makes it

much more obvious how things work at all levels, so that module authors

can easily determine how much data is supposed to be returned to them.

  1. … 11 more files in changeset.

Gotta use APR_STATUS_IS_EFOO() wrappers on all except our internally

defined status codes (e.g. APR_EOF and APR_STATUS tests are ok.)

Use the proper enum for the block/non-block parameter to apr_bucket_read().

A couple of these changed in meaning (e.g., 1->APR_BLOCK_READ).

PR: 6980

  1. … 5 more files in changeset.
Update copyright to 2001

  1. … 205 more files in changeset.
get rid of some warnings and an undefined reference which crept into

some modules overnight

  1. … 2 more files in changeset.
Change AddInputFilter and AddOutputFilter to SetInputFilter and

SetOutputFilter. This corresponds nicely with the other Set

directives, which operate on containers while the Add* directives

tend to work directly on extensions. [Ryan Bloom]

  1. … 4 more files in changeset.