Project

General

Profile

Is there a handler that is given each chunk of the chunkqueue?

Added by jannewmarch almost 14 years ago

I am trying to write a mod_substitute like the one in Apache. Basically, I want to include Java source code in my HTML pages by mod_ssi, but I have to massage special characters from the Java source like '<' and '&' into '&lt;' etc. Ideally I would like configurations that act on different file types e.g.

$HTTP["url"] =~ ".java$" {
substitute.match = ("<", "&")
substitute.replace = ("&lt;", "&amp;")
}

and I would like to apply these substitutions AFTER mod_ssi has inserted the component files.

mod_ssi builds a chunkqueue with chunks of the original document and the included files. From the handler handle_read_response_content (and other handlers) I can trawl the chunkqueue looking for chunks of type FILE_TYPE and see all the files I want to change. But I'm not getting the configuration data like above since that refers to the url of the document, not of its included components. Is there a handler that is given one chunk of the chunkqueue at a time with appropriate configuration? If not, is it worth adding? Or should I be doing this some other way?

Thanks

Jan