Apache HTTP Server Request Library
Defines | |
#define | APREQ_MODULE_NAME "APACHE2" |
#define | APREQ_MODULE_MAGIC_NUMBER 20040809 |
mod_apreq provides the "APREQ" input filter for using libapreq2 (and allow its parsed data structures to be shared) within the Apache 2.X webserver. Using it, libapreq2 works properly in every phase of the HTTP request, from translation handlers to output filters, and even for subrequests / internal redirects.
Normally the installation process triggered by make install
will make the necessary changes to httpd.conf for you. In any case, after installing the mod_apreq.so module, be sure your webserver's httpd.conf activates it on startup with a LoadModule directive, e.g.
LoadModule modules/mod_apreq.so
The mod_apreq filter is named "APREQ", and may be used in Apache's input filter directives, e.g.
AddInputFilter APREQ # or SetInputFilter APREQ
However, this is not required because libapreq2 will add the filter (only) if it's necessary. You just need to ensure that your module instantiates an apreq_request_t using apreq_request() before the content handler ultimately reads from the input filter chain. It is important to recognize that no matter how the input filters are initially arranged, the APREQ filter will attempt to reposition itself to be the last input filter to read the data.
If you want to use other input filters to transform the incoming HTTP request data, is important to register those filters with Apache as having type AP_FTYPE_CONTENT_SET or AP_FTYPE_RESOURCE. Due to the limitations of Apache's current input filter design, types higher than AP_FTYPE_CONTENT_SET may not work properly whenever the apreq filter is active.
This is especially true when a content handler uses libapreq2 to parse some of the post data before doing an internal redirect. Any input filter subsequently added to the redirected request will bypass the original apreq filter (and therefore lose access to some of the original post data), unless its type is less than the type of the apreq filter (currently AP_FTYPE_PROTOCOL-1).
Directive | Context | Default | Description |
---|---|---|---|
APREQ_MaxBody | directory | -1 (Unlimited) | Maximum number of bytes mod_apreq will send off to libapreq for parsing. mod_apreq will log this event and remove itself from the filter chain. The APR_EGENERAL error will be reported to libapreq2 users via the return value of apreq_env_read(). |
APREQ_MaxBrigade | directory | APREQ_MAX_BRIGADE_LEN | Maximum number of bytes apreq will allow to accumulate within a brigade. Excess data will be spooled to a file bucket appended to the brigade. |
APREQ_TempDir | directory | NULL | Sets the location of the temporary directory apreq will use to spool overflow brigade data (based on the APREQ_MaxBrigade setting). If left unset, libapreq2 will select a platform-specific location via apr_temp_dir_get(). |
XXX apreq as a normal input filter XXX apreq as a "virtual" content handler. XXX apreq as a transparent "tee".