mod_annot editor

Annotate Section


Filters currently register using
ap_register_output_filter(name, filter_func, filter_init, ftype)
and are inserted using
ap_add_output_filter(name, ctx, req, conn)

To update this to run in a smart filter context, we need to change this:

  • The filter should register itself with the harness and insertion criterion.
  • The filter should declare its effect on the HTTP protocol.

To handle this, we propose a new filter API
ap_register_smart_filter(name, match, filter_func, ctx, protocol_flags)
Now when the harness name is inserted in the filter chain, and there is a match with match, lookup_handler (referenced above) will returh our filter_func for filter name.

protocol_flags is an OR of flags such as

  • AP_FILTER_NO_TRANSFORM (filter passes content through unchanged - required when Cache-Control: no-transform applies)
  • AP_FILTER_PRESERVE_LENGTH (filter is a 1-1 mapping of bytes)
  • AP_FILTER_NO_BYTERANGES (filter won't work on byteranges)
  • AP_FILTER_NO_PROXY (don't use in a proxy)
  • AP_FILTER_NO_CACHE (don't let the document be cacheable downstream - probably wants refining)
  • AP_FILTER_NO_LOCAL_CACHE (don't let it be cacheable here)