DBG(r,"REQ[%X] User-Agent=[%s]", TO_ADDR(r), user_agent);
+ /*-------------------------------------------------------------------------*/
+ /* Do not process output_filter */
+ /*-------------------------------------------------------------------------*/
+ chxj_remove_filter(r);
rtn = s_img_conv_format_from_file(r, conf, user_agent, qsp, spec);
DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
return rtn;
request_conf = apr_palloc(r->pool, sizeof(mod_chxj_req_config));
request_conf->spec = NULL;
request_conf->user_agent = NULL;
+ request_conf->f = NULL;
chxj_set_module_config(r->request_config, &chxj_module, request_conf);
}
dconf = chxj_get_module_config(r->per_dir_config, &chxj_module);
char *user_agent;
device_table *spec;
mod_chxj_config *dconf;
+ mod_chxj_req_config *req_conf;
chxjconvrule_entry *entryp;
mod_chxj_ctx *ctx;
apr_status_t rv;
DBG(r, "REQ[%X] start %s()", TO_ADDR(r),__func__);
dconf = chxj_get_module_config(r->per_dir_config, &chxj_module);
+ req_conf = chxj_get_module_config(r->request_config, &chxj_module);
/* we get User-Agent from CHXJ_HTTP_USER_AGENT header if any */
user_agent = (char *)apr_table_get(r->headers_in, CHXJ_HTTP_USER_AGENT);
if (! apr_table_get(r->headers_in, "X-Chxj-Forward")) {
- ap_add_output_filter("chxj_output_filter", ctx, r, r->connection);
+ req_conf->f = ap_add_output_filter("chxj_output_filter", ctx, r, r->connection);
DBG(r, "REQ[%X] added Output Filter", TO_ADDR(r));
}
}
+void
+chxj_remove_filter(request_rec *r)
+{
+ mod_chxj_req_config *req_conf;
+
+ DBG(r, "REQ[%X] start %s()", TO_ADDR(r),__func__);
+ req_conf = chxj_get_module_config(r->request_config, &chxj_module);
+ if (req_conf && req_conf->f) {
+ ap_remove_output_filter(req_conf->f);
+ DBG(r, "REQ[%X] REMOVE Output Filter", TO_ADDR(r));
+ }
+ DBG(r, "REQ[%X] end %s()", TO_ADDR(r),__func__);
+}
+
+
/**
* The hook is registered.
*