Commit Graph

113 Commits

Author SHA1 Message Date
8026ae5889 Further to r599711; document new API guarantee for handling non-NULL
request_rec pointer when adding connection filters; minor MMN bump:

* server/util_filter.c (add_any_filter_handle): Set f->r for
  connection filters even if passed-in r is non-NULL.  Style nit fix
  also.

* include/util_filter.h (ap_add_output_filter,
  ap_add_output_filter_handle): Document new API guarantee.

* include/ap_mmn.h: Minor MMN bump.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@600473 13f79535-47bb-0310-9956-ffa450edef68
2007-12-03 10:55:58 +00:00
18f91519df * Use the correct pool when adding connection level filters.
Submitted by: jorton
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@599711 13f79535-47bb-0310-9956-ffa450edef68
2007-11-30 07:23:55 +00:00
f29b0683a2 * server/util_filter.c (ap_filter_flush): Tweak comment; no functional
change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583830 13f79535-47bb-0310-9956-ffa450edef68
2007-10-11 14:13:40 +00:00
c99d2c7276 * server/util_filter.c (ap_filter_flush): Ensure that the brigade is
empty before returning.

PR: 36780


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@583817 13f79535-47bb-0310-9956-ffa450edef68
2007-10-11 13:18:38 +00:00
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
f193cbabee Make ap_register_output_filter back into a function (*sigh*)
but update its API doc


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@315041 13f79535-47bb-0310-9956-ffa450edef68
2005-10-12 20:43:25 +00:00
5134335bee Make ap_register_output_filter a #define
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@315024 13f79535-47bb-0310-9956-ffa450edef68
2005-10-12 20:18:33 +00:00
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
4bc7f40b18 * server/util_filter.c (ap_save_brigade): Be more tolerant of a bucket
type which neither implements ->setaside nor morphs on ->read, such as
the mod_perl SV bucket type in mod_perl <1.99_17; defer returning an
error in this case until after calling setaside on each bucket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105664 13f79535-47bb-0310-9956-ffa450edef68
2004-11-01 23:04:05 +00:00
c48cfec2fd * server/util_filter.c (ap_save_brigade): Handle an ENOTIMPL setaside
function correctly.

* modules/generators/mod_cgi.c (cgi_handler): Revert r1.169,
unnecessary CGI bucket lifetime kludge.

PR: 31247


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105297 13f79535-47bb-0310-9956-ffa450edef68
2004-09-26 15:52:51 +00:00
72fb770d1a Merge mod_filter with util_filter structs; add API for protocol stuff.
Rename FilterDebug directive to FilterTrace.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105226 13f79535-47bb-0310-9956-ffa450edef68
2004-09-21 10:14:40 +00:00
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
aaf0424e2b get rid of _FOREACH
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101788 13f79535-47bb-0310-9956-ffa450edef68
2003-11-16 02:09:14 +00:00
3c95b5e98e While processing filters on internal redirects, remember seen EOS
buckets also in the request structure of the redirect issuer(s). This
prevents filters (such as mod_deflate) to add garbage to the response,
because ap_finalize_request_protocol won't send another EOS bucket then.

PR: 14451


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98699 13f79535-47bb-0310-9956-ffa450edef68
2003-02-18 00:23:20 +00:00
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
6deba78a9a Renames Pending:
This clears the list of renames pending in apr-util.
 Parts of this list was alreadu done, but the pending list hadn't been updated.

 apr_hook_debug_current     from apr_current_hooking_module
 apr_hook_debug_show        from apr_show_hook

 apr_hook_global_pool       from apr_global_hook_pool
 apr_hook_sort_all          from apr_sort_hooks

 apr_uri_port_of_scheme     from apr_uri_default_port_for_scheme
 apr_uri_unparse            from apr_uri_unparse_components
 apr_uri_parse              from apr_uri_parse_components
 apr_uri_parse_hostinfo     from apr_uri_parse_hostinfo_components

 apr_uri_t                  from apr_uri_components

 All APR_URI_*              from all APU_URI_* symbols
 All APR_UNP_*              from all UNP_* symbols

PR:
Obtained from:
Submitted by:	 Thom May
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95966 13f79535-47bb-0310-9956-ffa450edef68
2002-07-06 20:04:38 +00:00
798c1dae43 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95906 13f79535-47bb-0310-9956-ffa450edef68
2002-06-28 08:40:25 +00:00
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
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
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
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
6c111e95db When using mod_ssl, it is possible that we'd be called when there are no
protocol filters, so stop the segfault.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93755 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 08:58:21 +00:00
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
1fc7cb3778 make sure r->proto_xxput_filter gets updated as necessary when
deleting a filter from the chain


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93732 13f79535-47bb-0310-9956-ffa450edef68
2002-03-06 17:29:39 +00:00
2f43d87c48 Stop the loop when we have found the correct filter, or when the filter
list is over.  Do not stop if the next filter is NULL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93708 13f79535-47bb-0310-9956-ffa450edef68
2002-03-05 05:21:13 +00:00
b202fc0556 If we insert a protocol filter before we insert a request filter, we
must set the r->output_filter to r->proto_output_filter.  If we don't,
then as soon as we insert the request filter, the protocol filter will
be removed.  This was causing headers to not be sent on some requests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93692 13f79535-47bb-0310-9956-ffa450edef68
2002-03-04 05:29:04 +00:00
be6629235f I forgot the return, which mean meaningless log messages. This makes us
return the correct information.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93687 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 22:18:45 +00:00
596d79f14b This fixes most of the header bug that was committed last night. The server
is seg faulting on pipelined requests currently, but I want to get people
back to a running server.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93686 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 22:04:03 +00:00
0d7f234515 This finishes the mod_dir/mod_negotiation bug. This final part of the
solution ensures that we don't lose filters if they are added later than
we expect.  The problem could be seen if a connection filter was added
after a request-based filter was added in the past.  The problem was that
the request-based filters pointed to the first filter in the connection
record, so the new connection filter was never called.  Now, all filters
are put on their correct filter lists, and we are sure to always update
all pointers when adding a filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93683 13f79535-47bb-0310-9956-ffa450edef68
2002-03-03 06:04:08 +00:00
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
78656a3bf1 forgot the ap-declare's
the're needed for win32


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93545 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 03:58:05 +00:00
2df244dfda Added ap_get_input_filter_handle() and ap_get_output_filter_handle()
Submitted by:	Ryan Morgan
Reviewed by:	Brian Pane


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93544 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 03:12:31 +00:00
08002aaebb Added new functions ap_add_input_filter_handle() and
ap_add_output_filter_handle()

There are many places in the core modules where we do
ap_add_input_filter() or ap_add_output_filter() on a
hardcoded filter name (e.g., "CORE" or "BYTERANGE").
This requires a string-to-filter mapping that wastes
CPU time.  (Even though the string lookup uses a trie
for speed, it still ranks as a big consumer of CPU time
because of the large number of filters added per request.)

The new ap_add_*_filter_handle() functions will allow
us to skip the string-to-filter mapping in cases where
the module adding the filter happens to have the
ap_filter_rec_t* for the registered filter (e.g., because
it's the same module that registered the filter in the
first place).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93039 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 01:54:54 +00:00
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
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
b228a3b800 Fix a shadow variable. (c is also declared to be the connection.)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92635 13f79535-47bb-0310-9956-ffa450edef68
2001-12-28 05:46:21 +00:00
f4cf541a13 While contemplating a cast to (char) for the c arg to trie_node_link,
I decided it's more plesant to let the cpu not to think so hard (no
  wasted space, the c member will by word aligned anyways.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92449 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 16:39:08 +00:00
d99851e09d converted apr_pcalloc to apr_palloc for 15% reduction in run time of add_any_filter
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92142 13f79535-47bb-0310-9956-ffa450edef68
2001-11-23 11:07:51 +00:00
f2cd29ad41 replaced the hash used in add_any_filter() with a trie for 2.5x speedup
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92140 13f79535-47bb-0310-9956-ffa450edef68
2001-11-23 01:24:18 +00:00
cac07fa8d9 A very small optimization to the OLD_WRITE logic. This just makes us store
a pointer to the OLD_WRITE frec, and instead of using strcmp or strcasecmp,
we can just do a simple pointer comparison.  This optimization is also
available to other modules.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91006 13f79535-47bb-0310-9956-ffa450edef68
2001-09-11 18:38:21 +00:00
0fbd80ebb0 Jeff pointed out that the character array must be constant.
Well, it's not, so make it allocated from the correct pool rather than
the heap.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90891 13f79535-47bb-0310-9956-ffa450edef68
2001-09-04 16:28:45 +00:00
54a804a28e **NO CODE CHANGES**
This is a reformat commit *ONLY*
Please drive on through.

(One spelling tpyo fixed...)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90889 13f79535-47bb-0310-9956-ffa450edef68
2001-09-04 06:57:58 +00:00
4c59c0cfdc The ap_add_input_filter/ap_add_output_filter functions do an O(n) scan
through the list of registered filters.  This patch replaces the linear
list with a hash table for better performance.
Submitted by:	Brian Pane <bpane@pacbell.net>
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90888 13f79535-47bb-0310-9956-ffa450edef68
2001-09-04 06:50:52 +00:00
73b79caab0 fix ap_remove_output_filter; the recent change to use remove_any_filter made
it possible to wipe out the entire filter chain.  and then when
ap_finalize_request_protocol was called, r->output_filters was NULL,
preventing data from being flushed to the client.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90801 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 05:25:31 +00:00
73fc59156a remove_any_filter() and ap_remove_foo_filter() are void; how can you
return a value?


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90726 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 12:36:07 +00:00