From: Ryan Bloom Date: Thu, 17 Aug 2000 00:50:34 +0000 (+0000) Subject: Make ap_add_filter use a LIFO stack instead of a FIFO queue to add filters X-Git-Tag: APACHE_2_0_ALPHA_6~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fbcf521483dfa81e696d1a60cc34011cbecd3067;p=thirdparty%2Fapache%2Fhttpd.git Make ap_add_filter use a LIFO stack instead of a FIFO queue to add filters to the filter stack. This makes the chunking filter work. Without this, the core_filter is installed in the insert_filters hook, when we get to the ap_send_http_headers function, we insert the chunking filter, but it has been installed after the core_filter. This means the chunk_filter is never called. This reverses this. The core_filter is installed in the insert_filters hook, and we put the chunk_filter in during ap_send_http_headers. This time, the chunking filter is installed before the core_filter, and it gets called correctly. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86089 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/util_filter.h b/include/util_filter.h index ad6e5768360..00f7609903b 100644 --- a/include/util_filter.h +++ b/include/util_filter.h @@ -258,8 +258,8 @@ API_EXPORT(void) ap_register_filter(const char *name, * list of filters. Take note of that when adding your filter to the chain. */ /** - * Add a filter to the current request. Filters are added in a FIFO manner. - * The first filter added will be the first filter called. + * Add a filter to the current request. Filters are added in a LIFO manner. + * The first filter added will be the last filter called. * @param name The name of the filter to add * @param ctx Any filter specific data to associate with the filter * @param r The request to add this filter for. diff --git a/server/util_filter.c b/server/util_filter.c index 328fe036efb..ffc112ccb1b 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -91,7 +91,7 @@ static ap_filter_rec_t *registered_filters = NULL; ** corresponds to a different request. */ #define INSERT_BEFORE(f, before_this) ((before_this) == NULL \ - || (before_this)->ftype > (f)->ftype \ + || (before_this)->ftype >= (f)->ftype \ || (before_this)->r != (f)->r)