]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
register LuaOutputFilters with AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH
authorEric Covener <covener@apache.org>
Mon, 2 Sep 2013 17:06:16 +0000 (17:06 +0000)
committerEric Covener <covener@apache.org>
Mon, 2 Sep 2013 17:06:16 +0000 (17:06 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1519476 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/lua/mod_lua.c

diff --git a/CHANGES b/CHANGES
index a7a5d58141d3182c0cf62cbd45bc4a49fcf1c164..5864a31af23b3dc74672aff3fff737f702637784 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,11 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_lua: Register LuaOutputFilter scripts as changing the content and
+     content-length by default, when run my mod_filter.  Previously,
+     growing or shrinking a response that started with Content-Length set
+     would require mod_filter and FilterProtocol change=yes.
+
   *) mod_filter: Add "change=no" as a proto-flag to FilterProtocol
      to remove a providers initial flags set at registration time.
      [Eric Covener]
index 4d5d76242725202d9cc48251b0a3210e3135b622..4efe0e6dbaf8a182214b5d84a234f25240b601a1 100644 (file)
@@ -318,7 +318,10 @@ static apr_status_t lua_setup_filter_ctx(ap_filter_t* f, request_rec* r, lua_fil
     ctx = apr_pcalloc(r->pool, sizeof(lua_filter_ctx));
     ctx->broken = 0;
     *c = ctx;
-    /* Find the filter that was called */
+    /* Find the filter that was called.
+     * XXX: If we were wired with mod_filter, the filter (mod_filters name)
+     *      and the provider (our underlying filters name) need to have matched.
+     */
     for (n = 0; n < cfg->mapped_filters->nelts; n++) {
         ap_lua_filter_handler_spec *hook_spec =
             ((ap_lua_filter_handler_spec **) cfg->mapped_filters->elts)[n];
@@ -1083,7 +1086,8 @@ static const char *register_filter_function_hook(const char *filter,
     /* TODO: Make it work on other types than just AP_FTYPE_RESOURCE? */
     if (direction == AP_LUA_FILTER_OUTPUT) {
         spec->direction = AP_LUA_FILTER_OUTPUT;
-        ap_register_output_filter(filter, lua_output_filter_handle, NULL, AP_FTYPE_RESOURCE);
+        ap_register_output_filter_protocol(filter, lua_output_filter_handle, NULL, AP_FTYPE_RESOURCE,
+                                            AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH);
     }
     else {
         spec->direction = AP_LUA_FILTER_INPUT;