André Malo wrote:

* William A. Rowe, Jr. wrote:



Looking through the bugreports and the problems we have...
internal_fast_redirect saves some CPU cycles (I guess), but it's finally
(currently) an unclean thing.


André,
Would you list the PRs that you believe are related to fast redirects not working correctly? Perhaps there are some simple changes to get fast redirect working and perhaps there are some cases where we simply should not be using fast redirect.


I am able to fix the mod_expires problem by doing a test to definitively identify is a request is a subrequest or not (testing r->main is not sufficient). It would be easy to add code to make_sub_request() to set a flag if the SUBREQ_CORE filter is added. This flag would definitively identify if a request is a subrequest or not. Then we could test (r->is_subreq) rather than (r->main) and be assured of correctly identifying a subrequest.

This nasty hack will make mod_expires behave correctly with DirectoryIndex responses.

Index: mod_expires.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_expires.c,v
retrieving revision 1.43
diff -u -r1.43 mod_expires.c
--- mod_expires.c    30 May 2003 16:33:57 -0000    1.43
+++ mod_expires.c    31 May 2003 00:05:08 -0000
@@ -547,13 +547,23 @@
        return DECLINED;
    }

- /* Note: This is broken, DirectoryIndex files will not get an expires header
- * We should say -yes- to fast-redirects (which are not really subrequests)
- * but this check is not granular enough to distinguish between a fast-redirect
- * and a subrequest
+ /* Say no to subrequests but yes to requests about to be fast redirected
+ * Note: r->main is not a reliable indicator if a request is a subrequest
+ * or not. The best indicator of a subrequest is the presence of the
+ * SUBREQ_CORE filter (which is an AP_FTYPE_CONTENT_SET filter).
+ * This is a hack to cover us till we get a better mechanism for distingushing
+ * between subrequests, redirects and fast redirects.
*/
- if (r->main != NULL) { /* Say no to subrequests */
- return DECLINED;
+ if (r->main != NULL) {
+ /* This might be a subrequest */
+ ap_filter_t *f;
+ f = r->output_filters;
+ while (f && f->frec->ftype <= AP_FTYPE_CONTENT_SET) {
+ if (!strcmp(f->frec->name, "subreq_core")) {
+ return DECLINED;
+ }
+ f = f->next;
+ }
}


conf = (expires_dir_config *) ap_get_module_config(r->per_dir_config,



Reply via email to