]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Make sure the filter stack in a reused downstream connection is reset
authorGraham Leggett <minfrin@apache.org>
Tue, 10 Apr 2001 20:44:16 +0000 (20:44 +0000)
committerGraham Leggett <minfrin@apache.org>
Tue, 10 Apr 2001 20:44:16 +0000 (20:44 +0000)
so we don't get lots of DECHUNK filters when we don't want them.
PR:
Obtained from:
Reviewed by:

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

modules/proxy/mod_proxy.h
modules/proxy/proxy_http.c
modules/proxy/proxy_util.c

index 7a35204cb4ce0aa0f2fb0c22e2be4e469c423ee7..c0305b1c8a5d7e809736149134421bcc38b8b438 100644 (file)
@@ -243,5 +243,6 @@ int ap_proxy_is_word(struct dirconn_entry *This, apr_pool_t *p);
 int ap_proxy_checkproxyblock(request_rec *r, proxy_server_conf *conf, apr_sockaddr_t *uri_addr);
 int ap_proxy_pre_http_connection(conn_rec *c, request_rec *r);
 apr_status_t ap_proxy_string_read(conn_rec *c, apr_bucket_brigade *bb, char *buff, size_t bufflen);
+void ap_proxy_reset_output_filters(conn_rec *c);
 
 #endif /*MOD_PROXY_H*/
index 48ec878a88c14f28c86856edff15a490c6aa3223..e99aa2e653b95b489ac19557b5ad6c338060e129 100644 (file)
@@ -313,6 +313,9 @@ int ap_proxy_http_handler(request_rec *r, char *url,
        origin = conf->connection;
        new = 0;
 
+       /* reset the connection filters */
+       ap_proxy_reset_output_filters(origin);
+
        /* XXX FIXME: If the socket has since closed, change new to 1 so
         * a new socket is opened */
     }
@@ -699,6 +702,7 @@ int ap_proxy_http_handler(request_rec *r, char *url,
            if ((buf = ap_proxy_removestr(r->pool, buf, "chunked"))) {
                apr_table_set(r->headers_out, "Transfer-Encoding", buf);
            }
+/* FIXME: Make sure this filter is removed if this connection is reused */
            ap_add_input_filter("DECHUNK", NULL, rp, origin);
        }
 
index 92f65c4985931549e62d5a6948f50e8072d536a2..42c45648a339f43534c66440bace2253c96d081c 100644 (file)
@@ -1131,6 +1131,25 @@ apr_status_t ap_proxy_string_read(conn_rec *c, apr_bucket_brigade *bb, char *buf
 
 }
 
+/* remove other filters (like DECHUNK) from filter stack */
+void ap_proxy_reset_output_filters(conn_rec *c)
+{
+    ap_filter_t *f = c->output_filters;
+
+    while (f) {
+        if (!strcasecmp(f->frec->name, "CORE") ||
+            !strcasecmp(f->frec->name, "CONTENT_LENGTH") ||
+            !strcasecmp(f->frec->name, "HTTP_HEADER")) {
+            f = f->next;
+            continue;
+        }
+        else {
+            ap_remove_output_filter(f);
+            f = f->next;
+        }
+    }
+}
+
 #if defined WIN32
 
 static DWORD tls_index;