Parent Directory
|
Revision Log
| Links to HEAD: | (view) (annotate) |
| Sticky Revision: |
Fix a lot of doxygen warnings. Thanks to Brad Hards for the patch. I added a few more fixes, and there are still more that might need a doxygen expert. PR: 48061 Submitted by: Brad Hards Reviewed by: poirier
Update comments in util_filter.h about bucket and brigade ownership to reflect current practice and the advice from manual/developer/output-filters.xml. Submitted by: Rici Lake <rici ricilake.net> Reviewed by: Stefan Fritsch, Joe Orton
* include/util_filter.h (ap_fputstrs): Mark with sentinel attribute for gcc >= 4.
Prevent AP_FILTER_ERROR from being misinterpreted as SUSPENDED when checking the status code returned by a handler by updating the values of the filter error macros and consolidating them in httpd.h
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.
update license header text
Fix comment
Update the copyright year in all .c, .h and .xml files
Make ap_register_output_filter back into a function (*sigh*) but update its API doc
Make ap_register_output_filter a #define
Doxygen fixup / cleanup submited by: Neale Ranns neale ranns.org reviewed by: Ian Holsman
Update copyright year to 2005 and standardize on current copyright owner line.
general property cleanup
Change FilterDeclare/FilterProvider semantics as discussed in http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=109899588616670&w=2
Fixup broken handling of range header.
Move ap_filter_provider_t back out of public API (suggested by nd; makes sense to niq)
allow <= and >= for filter dispatcher
use more speaking names
more style
save spaces! Soon in future we're going to run out of spaces!!!
Merge mod_filter with util_filter structs; add API for protocol stuff. Rename FilterDebug directive to FilterTrace.
PR: 19688 Fix incorrect (and important) comments
fix name of The Apache Software Foundation
apply Apache License, Version 2.0
update license to 2004.
The caller of ap_pass_brigade() relinquishes ownership of the brigade.
clarify that filter_init_func is used only in the http protocol filters PR: Obtained from: Submitted by: Reviewed by:
* util_filter.h (ap_filter_flush): clarify that this function has
nothing to do with FLUSH buckets. It is simply a cover function
for ap_pass_brigade for use with the apr_brigade_* writing
functions.
Clarified comment on arg constraints for ap_get_brigade() Submitted by: Joe Schaefer <joe+gmane@sunstarsys.com> Reviewed by: Brian Pane
finished that boring job: update license to 2003. Happy New Year! ;-))
Update documentation to match prototype for ap_register_input_filter and
ap_register_output_filter.
Submitted by: Stas Bekman <stas@stason.org>,
Joe Schaefer <joe+apache@sunstarsys.com>
Reviewed by: Justin Erenkrantz
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
Fix doxygen comments and add a missing line-feed.
Style cleanups before contemplating adding init filter hook. (No functional changes)
Update our copyright for this year.
Comments like this help keep the sanity of module authors.
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.
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
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.
document the ctx parameter to the add-input-filter functions
Added ap_get_input_filter_handle() and ap_get_output_filter_handle() Submitted by: Ryan Morgan Reviewed by: Brian Pane
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).
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
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)
add new input filter mode AP_MODE_INIT: allows filters such as mod_ssl to initialize a client connection (ie handshake) before reading request data from the client. PR: Obtained from: Submitted by: dougm Reviewed by: wrowe
Correct Verbage in comments. Submitted by: Aarron Bannert <aaron@clove.org> Reviewed by: Ian Holsman <IanH@apache.org>
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.
Allow mod_ssl to send back an error message if an HTTP request is sent over an HTTPS connection. This also adds an ap_remove_input_filter function, which should be used to remove the SSL input filter in this case, as soon as this code is stressed a bit more. For right now, we are sending the same message that we used to send in mod_ssl for Apache 1.3.
Remove all warnings from the input filtering stack.
Document and future-proof the dependency between apr_read_type_e and ap_input_mode_t. It's now safe(r) to cast from ap_read_type_e to ap_input_mode_t. Submitted by: Justin Erenkrantz, Sander Striker
Add a pool to the ap_save_brigade prototype. This removes a todo from the comments that is really necessary before the setaside stuff will work properly.
Convert the filter and brigade writing functions to return status values, not byte counts.
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.
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.
Document the new argument to ap_get_brigade()
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.
The ap_f* functions should flush data to the filter that is passed in, not to the filter after the one passed in. The fixes a bug, where one filter is skipped when using ap_f*. Submitted by: Ryan Morgan <rmorgan@covalent.net>
More doxygenation.
Add a couple of GCC attribute tags to printf style functions. This also fixes a couple of mismatched parameters highlighted revealed by the attribute. Submitted by: Jon Travis <jtravis@covalent.net>
Update copyright to 2001
First cut of TLS support.
Clean up some of the includes: - explicitly include apr_lib.h since ap_config.h doesn't - use apr_want.h where possible - use APR_HAVE_ where possible - remove some unneeded includes
"v" in the name has come to mean that a va_arg is in the parameter list. putstrs is clearer in this case.
Fix another windows compile break.
A few small docs changes (there were ';' in the ScanDoc), and remove some very cool but totally unportable macros. :-(
*) namespace protect the filter_flush() function *) don't toss the status value from ap_pass_brigade in ap_fflush; return it *) doc/macro nits
Allow filters to buffer data in a brigade using the ap_f* functions. These have become simple macros that just wrap the apr_brigade functions, allowing filter writers to ignore the flush function and the ctx pointer.
Improved(?) docco.
filters can now report an HTTP error to the server. This is done by sending a brigade where the first bucket is an error_bucket. This bucket is a simple bucket that stores an HTTP error and a string. Currently the string is not used, but it may be needed to output an error log. The http_header_filter will find this bucket, and output the error text, and then return AP_FILTER_ERROR, which informs the server that the error web page has already been sent.
AP_REQUEST_DONE is bogus and a bad idea. This had the http_header filter return -3 for every HEAD request, which in turn made us call ap_die. Of course, if we didn't have a 200 status (say we had a 206), then we would seg fault, because we would end up sending down a second EOS bucket, which would in turn make us call the byterange filter again, but at this point, we hadn't cleaned up the byterange ctx structure, because it was never supposed to be called again. This was biting us on apache.org, where we had a HEAD request for bytes=100- for a file. This was a major seg fault. We are better off just returning OK is much safer.
The big change. This is part 3 of the apr-util symbols rename, please see the first commit of srclib/apr-util/include (cvs apr-util/include) for the quick glance at symbols changed.
ap_save_brigade() can fail, so report what happened via an apr_status_t return code.
Stop the default_handler from trying to deal with HEAD requests. By doing this, the content-length filter can determine the C-L before we send the response, and we get a better response.
Fix a typo in a comment. Submitted by: Chris Pepper <pepper@mail.reppep.com> Reviewed by: Jeff Trawick
Provide a bit of doc for the hackish^H^H^H^H^H^H^Hwonderful filter types I introduced yesterday.
Introduce more filter types. This gets chunking of output working again by ensuring that the chunk filter gets added after the http headers filter.
Add a way to remove output filters. This is used by http_header_filter to remove itself once it has actually sent the headers.
Input filters and ap_get_brigade() now have a input mode parameter (blocking, non-blocking, peek) instead of a length parameter.
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.
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
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.
Remove stray semicolon from AP_NOBODY_READ and AP_NOBODY_WROTE decls. Remove some out-of-date ap_pass_brigade() doc. Tweak the ap_get_brigade() doc a little.
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
Now that we have ap_add_input_filter(), rename ap_add_filter() to ap_add_output_filter().
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
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.
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.
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.
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.
put ctx back in ap_add_filter()
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.
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.
reversing the latest commit; it was vetoed a while back.
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.
Filters (and thus ap_pass_brigade()) now return an apr_status_t as their return value.
this shouldn't have gone in yet. there is still pending discussion.
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.
a filter's context is to be used however the filter likes. it is a void*,
not necessarily a bucket brigade.
Fix some typos in the comments.
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.
document util_filter.h using Scandoc
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
Fix a small name mix-up. Filters are part of Apache, and should have the ap_ prefix, not apr_
prefix libapr functions and types with apr_
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
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
| apache@apache.org | ViewVC Help |
| Powered by ViewVC 1.1.2 |