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*/
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 */
}
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);
}
}
+/* 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;