httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentine Sinitsyn <e_...@inbox.ru>
Subject Re[3]: [users@httpd] mod_filter and apache-2.0
Date Sat, 20 Nov 2004 19:10:23 GMT
>> Yes, I did checkout util-filter.h from CVS along with

NK> That's not at all the same.  Let us know if it works, but I wouldn't
NK> be too surprised if it breaks something else in 2.0.

NK> Actually, if it does work, that in itself is a useful thing to know!
No, util-filter.h from MAIN branch does not work. I think Apache 2.1
and 2.0 are not fully source compatible (not surprising thing).
Several days ago I tried to install mod_disk_cache from MAIN and it
also break my Apache 2.0.52

I tried the patch you suggested. Now httpd itself compiled just fine,
but 'apxs -a -c -i mod_filter.c' failed. This was because "enum {...}
dispatch;" was found twice: in util_filter.h (struct ap_filter_rec_t)
and in mod_filter.c itself (in struct ap_filter_provider_t). When I
put this enum alone, named it ap_dispatch_type and modified the
corresponding structs everything ran fine. I was able to start and use
Apache without any segfaults or similar stuff. I also made FilterChain
for mod_deflate to compress only text/* responses. I did see oddness
in module behavior but it is probably because I made
quick-and-dirty setup. From technical point of view, mod_filter ran on
my apache 2.0.52 with no errors.

In case you will be interested in, I'm sending patches for
util_filter.h (merged with yours util-2.0-patch) and mod_filter.c.
Please note that they should be applied with -R flag

util_filter.h.patch:
--- util_filter.h       2004-11-20 23:29:14.982862184 +0000
+++ util_filter.h.orig  2004-02-09 20:54:34.000000000 +0000
@@ -197,16 +197,6 @@
  */
 
 typedef struct ap_filter_rec_t ap_filter_rec_t;
-typedef struct ap_filter_provider_t ap_filter_provider_t;
-
-/** Dispatch criteria for filter providers */
-typedef enum {
-    HANDLER,
-    REQUEST_HEADERS,
-    RESPONSE_HEADERS,
-    SUBPROCESS_ENV,
-    CONTENT_TYPE
-} ap_dispatch_type;
 
 /**
  * This structure is used for recording information about the
@@ -215,13 +205,7 @@
  *
  * At the moment, these are simply linked in a chain, so a ->next pointer
  * is available.
- *
- * It is used for any filter that can be inserted in the filter chain.
- * This may be either a httpd-2.0 filter or a mod_filter harness.
- * In the latter case it contains dispatch, provider and protocol information.
- * In the former case, the new fields (from dispatch) are ignored.
  */
- 
 struct ap_filter_rec_t {
     /** The registered name for this filter */
     const char *name;
@@ -241,19 +225,6 @@
 
     /** The next filter_rec in the list */
     struct ap_filter_rec_t *next;
-    
-    ap_dispatch_type dispatch;
-
-    /** Match value for filter providers */
-    const char* value ;
-    /** Providers for this filter */
-    ap_filter_provider_t* providers ;
-    /** Trace level for this filter */
-    int debug ;
-    /** Protocol flags for this filter */
-    unsigned int proto_flags ;
-    /** Save Ranges header if this filter unsets it */
-    const char* range ;
 };
 
 /**
@@ -537,19 +508,6 @@
                                            ...)
         __attribute__((format(printf,3,4)));                                    
 
-/** Filter changes contents (so invalidating checksums/etc) */
-#define AP_FILTER_PROTO_CHANGE 0x1
-/** Filter changes length of contents (so invalidating content-length/etc) */
-#define AP_FILTER_PROTO_CHANGE_LENGTH 0x2
-/** Filter requires complete input and can't work on byteranges */
-#define AP_FILTER_PROTO_NO_BYTERANGE 0x4
-/** Filter should not run in a proxy */
-#define AP_FILTER_PROTO_NO_PROXY 0x8
-/** Filter makes output non-cacheable */
-#define AP_FILTER_PROTO_NO_CACHE 0x10
-/** Filter is incompatible with "Cache-Control: no-transform" */
-#define AP_FILTER_PROTO_TRANSFORM 0x20
-
 #ifdef __cplusplus
 }
 #endif


mod_filter.c.patch:
--- mod_filter.c        2004-11-20 23:30:41.186757200 +0000
+++ mod_filter.c.orig   2004-11-19 15:23:00.000000000 +0000
@@ -77,7 +77,13 @@
     ap_filter_provider_t *next;
 
     /** Dispatch criteria for filter providers */
-    ap_dispatch_type dispatch;
+    enum {
+        HANDLER,
+        REQUEST_HEADERS,
+        RESPONSE_HEADERS,
+        SUBPROCESS_ENV,
+        CONTENT_TYPE
+    } dispatch;
 
     /** Match value for filter providers */
     const char* value;

Regards,
Valentine


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message