1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-26 05:42:34 +03:00
Commit Graph

38 Commits

Author SHA1 Message Date
Greg Stein
6838403b9e minor tweaks, cleanup, comments.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86882 13f79535-47bb-0310-9956-ffa450edef68
2000-11-09 10:21:12 +00:00
Ryan Bloom
20a7482f93 Add a comment about a requirement with the eos_sent variable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86742 13f79535-47bb-0310-9956-ffa450edef68
2000-10-25 10:47:51 +00:00
Bill Stoddard
458ab19e56 Fix some brain dead code.
Submitted by: Greg Stein
Reviewed by:  Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86706 13f79535-47bb-0310-9956-ffa450edef68
2000-10-22 15:53:27 +00:00
Bill Stoddard
d915406c82 Correct a check to see if we are attempting to remove a filter that has
already been removed from the stack. Hummm, seems to me we should not
attempt to remove filters multiple times....


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86705 13f79535-47bb-0310-9956-ffa450edef68
2000-10-22 15:48:34 +00:00
Ryan Bloom
1c795234e1 Add a way to remove output filters. This is used by http_header_filter to
remove itself once it has actually sent the headers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86690 13f79535-47bb-0310-9956-ffa450edef68
2000-10-21 17:22:28 +00:00
Jeff Trawick
96cf82e63b Input filters and ap_get_brigade() now have a input mode parameter
(blocking, non-blocking, peek) instead of a length parameter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86684 13f79535-47bb-0310-9956-ffa450edef68
2000-10-21 13:20:36 +00:00
William A. Rowe Jr
d6490633eb Renamed all MODULE_EXPORT symbols to AP_MODULE_DECLARE and all symbols
for CORE_EXPORT to AP_CORE_DECLARE (namespace protecting the wrapper)
  and retitled API_EXPORT as AP_DECLARE and APR_EXPORT as APR_DECLARE.
  All _VAR_ flavors changes to _DATA to be absolutely clear.
  Thank you Greg, for the most obvious suggestion.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86609 13f79535-47bb-0310-9956-ffa450edef68
2000-10-16 06:05:15 +00:00
Ryan Bloom
b73fb78446 Stop using the index into the array for the bucket type. Now we just use
a pointer to a static structure.  The ap_foo_type functions have also been
replaced with simple macro calls.  I am going to replace the
ap_bucket_(read|split|setaside|destroy) functions with macros soon.
Reviewed by:	Will Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86597 13f79535-47bb-0310-9956-ffa450edef68
2000-10-15 18:15:13 +00:00
Ryan Bloom
745e689f7c Remove all function pointers from the ap_bucket type. These function
pointers are replaced with a global table that allows modules to register
their bucket types.  Those bucket types are then allowed to be used in
the server processing.  This also required removing all direct calls to
those functions.  The ap_bucket type has an index into an array, so in
each ap_bucket_* function, we use that index to find the correct set of
functions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86575 13f79535-47bb-0310-9956-ffa450edef68
2000-10-13 05:35:57 +00:00
Ryan Bloom
ca0b9e8443 Fix a typo from earlier today. The filters accept apr_ssize_t's, so the
get_brigade code should also use apr_ssize_t.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86572 13f79535-47bb-0310-9956-ffa450edef68
2000-10-13 00:02:06 +00:00
Ryan Bloom
c27033df76 Implement a length argument on input filters. There are three possible
values for the length, -1, 0, and a positive number.  -1 means that the
next filter should return all the data it has, the current filter will
take care to ensure that the protocol is followed.  Most filters will
never use this, because it implies they are implementing a conn_based
input filter.  0 means give me exactly one line of data.  A positive
number means give me a maximum of n bytes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86567 13f79535-47bb-0310-9956-ffa450edef68
2000-10-12 16:35:39 +00:00
Jeff Trawick
b7d765272e Add a bit of infrastructure which will be needed for input filtering:
1) separate filter lists hanging off the r and the c

   requests start off with the same filter list as the connection

   the input filter list is not initialized for subrequests

   internal redirects start off with the same filter list as the
   connection

2) AddInputFilter directive (blatant rip-off of Ryan's AddOutputFilter
   directive); as with AddOutputFilter, the network is implicitly to the
   right of the specified filter list; this may not be the most
   intuitive way to specify the filters; not sure yet


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86403 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 16:55:10 +00:00
Jeff Trawick
a9a0b56629 Now that we have ap_add_input_filter(), rename ap_add_filter() to
ap_add_output_filter().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86401 13f79535-47bb-0310-9956-ffa450edef68
2000-10-05 12:01:48 +00:00
Ryan Bloom
8b56ba850a Connection oriented filters are now stored in the conn_rec instead of the
request_rec.  This means that a conn_rec must be supplied when calling
ap_add_filter.  The reason for this change is that we need to be able to
add the core_filter (whether or SSL or not) before we try to read the
request.  This way, if a request fails, we can actually send the error
page back to the client.  With this change, we add the core filter to the
conn_rec during the pre-connection phase.
Submitted by:	Ryan Bloom, Jeff Trawick, and Greg Ames


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86392 13f79535-47bb-0310-9956-ffa450edef68
2000-10-04 23:19:33 +00:00
Ryan Bloom
3d31ec804b Replace ap_get_data_from_filter and ap_save_data_to_filter with
ap_save_brigade.  This function does not try to save the actual brigade to
a specific location.  If just traverses the brigade, calls setaside if
it is available and concatenates it with a previously setaside brigade.

The resulting brigade is returned to the caller for them to save it to
the appropriate location.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86370 13f79535-47bb-0310-9956-ffa450edef68
2000-10-03 00:44:00 +00:00
Bill Stoddard
c34b70d666 Fix two problems. First we are setting aside the wrong bucket brigade. Second, we need to
check that a setaside routine is defined for the bucket before attempting to call it.  Not sure
at all if we even want to keep this routine as it does not allow using filter->ctx for other
purposes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86365 13f79535-47bb-0310-9956-ffa450edef68
2000-10-02 22:00:59 +00:00
Ryan Bloom
7ae2f294fd Implement input filtering. This is definately not completely correct, but
it is a good first step.  It is possible to add filters when reading from
the client with this change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86359 13f79535-47bb-0310-9956-ffa450edef68
2000-10-02 00:47:28 +00:00
Jeff Trawick
f8453ca3af Fix filter registration so that the appropriate list of
registrations is actually modified.  This allows Apache to server
pages again.  (Before this, every ap_add_filter() silently failed
and so output content went to the bit bucket.)

Also, repair some comments and un-namespace-protect a now-static
function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86255 13f79535-47bb-0310-9956-ffa450edef68
2000-09-19 23:28:55 +00:00
Ryan Bloom
96c98ff58b tart getting things setup for input filtering. All this basically does
is add part of the infrastructure.  Namely:

1) filter list in the conn_rec, which is where the input filter list
   must live

2) Split the register_filter into multiple functions, one to register
   input filters the other to register output filters.

3) Modify existing modules so they still work.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86251 13f79535-47bb-0310-9956-ffa450edef68
2000-09-19 20:56:09 +00:00
Ryan Bloom
29e68ae602 Change r->filters to r->output_filters. This sets things up for us to
put input filters into Apache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86246 13f79535-47bb-0310-9956-ffa450edef68
2000-09-18 01:24:55 +00:00
Doug MacEachern
dad154a2ca put ctx back in ap_add_filter()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86224 13f79535-47bb-0310-9956-ffa450edef68
2000-09-14 05:08:42 +00:00
Ryan Bloom
b0cfe2c764 Add a pointer to the filter_rec_t from the filter_t. This allows modules
to get to the filter name from the filter itself.  This is useful for
modules like mod_perl, which have one filter function that does different
things based on the name used when the filter was inserted.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86221 13f79535-47bb-0310-9956-ffa450edef68
2000-09-14 00:34:15 +00:00
Ryan Bloom
9c295f8e68 Add the AddFilter directive. This directive takes a list of filter names
that have been previously registered with the server.  Currently the
directive is only valid inside the config file, but once the Options
directive is tweaked a bit, I would feel more comfortable exposing this
directive to htaccess files.

As a part of making adding this filter, I removed the ctx pointer from the
ap_add_filter prototype.  The problem is that the core is the thing that
is actually inserting the filter into the filter stack, but the core doesn't
know how to allocate memory for each filter.  The solution is to have the
filters themselves be responsible for allocating the ctx memory whenever
it is required.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86220 13f79535-47bb-0310-9956-ffa450edef68
2000-09-13 23:13:20 +00:00
Ryan Bloom
9acfd7de2d Ensure that only one EOS bucket is sent down the filter stack. This is
done by adding a flag to the request_rec.  When ap_pass_bucket sees an
EOS bucket, the flag is set.  If the flag is still unset when
ap_finalize_request is called, then ap_finalize_request sends an EOS.  This
fixes the problem with chunking and CGI.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86202 13f79535-47bb-0310-9956-ffa450edef68
2000-09-12 03:40:15 +00:00
Tony Finch
7ac6ab9f51 Use wrapper macros to avoid the verbosity of the AP_RING macros when
doing things with bucket brigades.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86185 13f79535-47bb-0310-9956-ffa450edef68
2000-09-09 06:48:10 +00:00
Tony Finch
6d7be19c90 Reduce the manualarity of managing bucket brigade lists by using the
new AP_RING macros. Most of this commit is fairly pedestrian as you
would expect, but I had to redo the chunking filter because of the
amount of pointer juggling it did. I have done some minimal testing
of this patch and it seems to work.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86178 13f79535-47bb-0310-9956-ffa450edef68
2000-09-08 10:16:14 +00:00
Greg Stein
a1d3d62fc6 reversing the latest commit; it was vetoed a while back.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86162 13f79535-47bb-0310-9956-ffa450edef68
2000-08-30 01:09:09 +00:00
Ryan Bloom
eab77d60ac Modify the way filters are added to the server. Instead of using a FIFO,
we use a modified LIFO.  It is modified, because if we add a filter while
in the middle of another filter, the added filter gets put in after the
current filter.  This requires that the server is smart about which filters
are added when.  This should be handled by the HTTP protocol, but we will
want to keep and eye on things for a little while.

This change is necessary, because currently when we add a filter it goes
after the last filter of the same type.  This is broken whenever we want
to add a filter that has a dependancy.  Think about the core and chunking
filters.  They are of the same type, and core is always added first.  When
we go to insert chunking, it gets added, but it is never called.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86161 13f79535-47bb-0310-9956-ffa450edef68
2000-08-29 22:16:45 +00:00
Jeff Trawick
f357ceef76 Filters (and thus ap_pass_brigade()) now return an apr_status_t as their
return value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86160 13f79535-47bb-0310-9956-ffa450edef68
2000-08-29 20:57:29 +00:00
Greg Stein
04bf273329 this shouldn't have gone in yet. there is still pending discussion.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86091 13f79535-47bb-0310-9956-ffa450edef68
2000-08-17 01:10:07 +00:00
Ryan Bloom
fbcf521483 Make ap_add_filter use a LIFO stack instead of a FIFO queue to add filters
to the filter stack.  This makes the chunking filter work.  Without this,
the core_filter is installed in the insert_filters hook, when we get
to the ap_send_http_headers function, we insert the chunking filter, but
it has been installed after the core_filter.  This means the chunk_filter
is never called.

This reverses this.  The core_filter is installed in the insert_filters
hook, and we put the chunk_filter in during ap_send_http_headers.  This
time, the chunking filter is installed before the core_filter, and it
gets called correctly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86089 13f79535-47bb-0310-9956-ffa450edef68
2000-08-17 00:50:34 +00:00
Greg Stein
19fcd34452 Ryan's recent, suggested patch in this area pointed out that we were
missing the needed comparison on the request. this allows subrequests to
    insert filters properly (by stopping the scan before transitioning to
    the parent request's filters)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86085 13f79535-47bb-0310-9956-ffa450edef68
2000-08-16 19:28:27 +00:00
Jeff Trawick
af4a85eb2d When ap_register_filter() registers a cleanup function, specify
apr_null_cleanup() instead of NULL to indicate that no child
cleanup is desired.  (With NULL, we branch to zero.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86072 13f79535-47bb-0310-9956-ffa450edef68
2000-08-14 17:50:02 +00:00
Ryan Bloom
ffbfb21445 Add an error condition to the filter code. Basically, if somehow we get
to the very bottom of the filter stack and nobody has written anything to
the network, then we need to return an error.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86062 13f79535-47bb-0310-9956-ffa450edef68
2000-08-12 23:59:13 +00:00
Ryan Bloom
35d4c4a58c Initial Filtering code. This uses a bucket brigade scheme to allow modules
to add and modify data while processing a request.  The docs still need
to be updated, and a simple html page needs to be created explaining all
of this.

The only filter currently in the code is the core filter.  This filter
takes a bucket brigade and writes it to the network through the buff
structure.  In time, the buff will go away completely.

More filters will need to be written.
Submitted by:	The Apache Community
Reviewed by:	The Apache Community


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86059 13f79535-47bb-0310-9956-ffa450edef68
2000-08-12 18:45:35 +00:00
Ryan Bloom
cfba61eb34 Fix a small name mix-up. Filters are part of Apache, and should have the
ap_ prefix, not apr_


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85994 13f79535-47bb-0310-9956-ffa450edef68
2000-08-05 04:38:58 +00:00
Doug MacEachern
059d8dd212 prefix libapr functions and types with apr_
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85976 13f79535-47bb-0310-9956-ffa450edef68
2000-08-02 05:27:38 +00:00
Ryan Bloom
f89738e6b6 Add the ability to register filters. This commit introduces a warning
into the build.  This warning will be removed automatically, as soon as
we decide on a prototype for the function causing the warning.  That
decision is tied to which filtering mechanism we decide on.
Submitted by:	Ryan Bloom and Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85926 13f79535-47bb-0310-9956-ffa450edef68
2000-07-28 20:31:02 +00:00