]> granicus.if.org Git - apache/commitdiff
Remove the prev pointer from the filter chain. This removes
authorRyan Bloom <rbb@apache.org>
Thu, 7 Mar 2002 02:09:30 +0000 (02:09 +0000)
committerRyan Bloom <rbb@apache.org>
Thu, 7 Mar 2002 02:09:30 +0000 (02:09 +0000)
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

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93745 13f79535-47bb-0310-9956-ffa450edef68

include/util_filter.h
server/core.c
server/protocol.c
server/request.c
server/util_filter.c

index 60ea804b94bc16fbbb3635632996bd66b009e39d..19d845afb96a3b70c4dbd9619778330f5be2ca84 100644 (file)
@@ -263,9 +263,6 @@ struct ap_filter_t {
     /** The next filter in the chain */
     ap_filter_t *next;
 
-    /** The previous filter in the chain */
-    ap_filter_t *prev;
-
     /** The request_rec associated with the current filter.  If a sub-request
      *  adds filters, then the sub-request is the request associated with the
      *  filter.
index 7d95e1f0299ea0422ea4a5eb4b70409c735d08e5..3c708d9b1c6eeee3d6459df1681eb2097c1d0422 100644 (file)
@@ -4040,7 +4040,7 @@ static void register_hooks(apr_pool_t *p)
                                   AP_FTYPE_NETWORK);
     ap_subreq_core_filter_handle =
         ap_register_output_filter("SUBREQ_CORE", ap_sub_req_output_filter,
-                                  AP_FTYPE_HTTP_HEADER);
+                                  AP_FTYPE_CONTENT + 5);
     ap_old_write_func = ap_register_output_filter("OLD_WRITE",
                                    ap_old_write_filter, AP_FTYPE_CONTENT - 10);
 }
index 5a97dc6a96168373d65bdf14269ab68913ba92af..d7ce8f50d0e7018096229aa8a817c61b13057310 100644 (file)
@@ -777,9 +777,6 @@ request_rec *ap_read_request(conn_rec *conn)
     r->request_config  = ap_create_request_config(r->pool);
     /* Must be set before we run create request hook */
 
-    conn->output_filters->prev = NULL;
-    conn->input_filters->prev = NULL;
-
     r->proto_output_filters = conn->output_filters;
     r->output_filters  = r->proto_output_filters;
     r->proto_input_filters = conn->input_filters;
index 0a7e0b55d17f983529ebff1362d0aa8bc3deb52f..3f022c070774aaba8265c779e3f478bba29a443d 100644 (file)
@@ -1499,7 +1499,7 @@ static request_rec *make_sub_request(const request_rec *r,
         rnew->input_filters  = r->input_filters;
         rnew->proto_input_filters  = r->proto_input_filters;
         rnew->output_filters = next_filter;
-       rnew->proto_output_filters = r->connection->output_filters;
+       rnew->proto_output_filters = r->proto_output_filters;
         ap_add_output_filter_handle(ap_subreq_core_filter_handle,
                                     NULL, rnew, rnew->connection); 
     }
index c818de90515cb07f0cb89983557e1445f5ea1a66..e0032c986a317c1c7c3f5822ed2346f8a60faf16 100644 (file)
@@ -329,7 +329,7 @@ static ap_filter_t *add_any_filter_handle(ap_filter_rec_t *frec, void *ctx,
     f->ctx = ctx;
     f->r = r;
     f->c = c;
-    f->next = f->prev = NULL;
+    f->next = NULL;
 
     if (INSERT_BEFORE(f, *outf)) {
         f->next = *outf;
@@ -351,10 +351,6 @@ static ap_filter_t *add_any_filter_handle(ap_filter_rec_t *frec, void *ctx,
             }
             if (first && first != (*outf)) {
                 first->next = f;
-                f->prev = first;
-            }
-            if (*outf && ((*outf)->prev == first)) {
-                (*outf)->prev = f;
             }
         }
         *outf = f;
@@ -365,11 +361,7 @@ static ap_filter_t *add_any_filter_handle(ap_filter_rec_t *frec, void *ctx,
             fscan = fscan->next;
 
         f->next = fscan->next;
-        if (fscan->next->prev == fscan) {
-            f->prev = fscan;
-            fscan->next->prev = f;
-            fscan->next = f;
-        }
+       fscan->next = f;
     }
 
     if (frec->ftype < AP_FTYPE_CONNECTION && (*r_filters == *c_filters)) {
@@ -472,7 +464,6 @@ static void remove_any_filter(ap_filter_t *f, ap_filter_t **r_filt, ap_filter_t
 
     if (*curr == f) {
         *curr = (*curr)->next;
-        (*curr)->prev = NULL;
         return;
     }
 
@@ -483,7 +474,6 @@ static void remove_any_filter(ap_filter_t *f, ap_filter_t **r_filt, ap_filter_t
     }
 
     fscan->next = f->next;
-    f->next->prev = fscan;
 }
 
 AP_DECLARE(void) ap_remove_input_filter(ap_filter_t *f)