You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by jo...@apache.org on 2004/08/09 07:12:19 UTC
cvs commit: httpd-apreq-2/env mod_apreq.c
joes 2004/08/08 22:12:19
Modified: env mod_apreq.c
Log:
Document issues with AP_FTYPE_CONTENT_SET and AP_FTYPE_PROTOCOL input filters, and fix strcmp's: one bogus one removed, and the other replaced by strcasecmp since Apache downcases the filter name during ap_register_input_filter.
Revision Changes Path
1.60 +20 -7 httpd-apreq-2/env/mod_apreq.c
Index: mod_apreq.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/mod_apreq.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- mod_apreq.c 8 Aug 2004 18:42:05 -0000 1.59
+++ mod_apreq.c 9 Aug 2004 05:12:19 -0000 1.60
@@ -124,6 +124,20 @@
* to read the data. In other words, <code>r->input_filters</code> will
* always point to the active APREQ filter for the request.
*
+ * 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_RESOURCE. Due to limitations in Apache's
+ * current input filter design, the other possibly relevant filter types -
+ * AP_FTYPE_CONTENT_SET or AP_FTYPE_PROTOCOL - 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 AP_FTYPE_RESOURCE.
+ *
+ *
* <h2>Server Configuration Directives</h2>
*
* <TABLE class="qref"><CAPTION>Per-directory commands for mod_apreq</CAPTION>
@@ -157,7 +171,7 @@
#define APREQ_MODULE_NAME "APACHE2"
-#define APREQ_MODULE_MAGIC_NUMBER 20040808
+#define APREQ_MODULE_MAGIC_NUMBER 20040809
static void apache2_log(const char *file, int line, int level,
apr_status_t status, void *env, const char *fmt,
@@ -256,9 +270,6 @@
if (cfg->f == r->input_filters)
return cfg->f;
- if (strcmp(r->input_filters->frec->name, filter_name) == 0)
- return cfg->f = r->input_filters;
-
cfg->f = ap_add_input_filter(filter_name, NULL, r, r->connection);
/* ap_add_input_filter does not guarantee cfg->f == r->input_filters,
@@ -500,14 +511,16 @@
in = in->next)
{
if (f == in) {
- if (strcmp(r->input_filters->frec->name, filter_name) == 0) {
- /* this intermediate apreq filter is superfluous- remove it */
+ if (strcasecmp(r->input_filters->frec->name, filter_name) == 0) {
+ apreq_log(APREQ_DEBUG 0, r,
+ "removing intermediate apreq filter");
if (cfg->f == f)
cfg->f = r->input_filters;
ap_remove_input_filter(f);
}
else {
- /* move to top and register it */
+ apreq_log(APREQ_DEBUG 0, r,
+ "relocating intermediate apreq filter");
apreq_filter_relocate(f);
cfg->f = f;
}