request_conf = apr_pcalloc(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);
}
s_add_no_cache_headers(r, entryp);
/* must not send body. */
rv = pass_data_to_filter(f, "", 0);
- chxj_specified_cleanup(r);
DBG(f->r, "REQ[%X] end of %s()", TO_ADDR(r),__func__);
return rv;
}
}
s_add_no_cache_headers(r, entryp);
ap_pass_brigade(f->next, bb);
- chxj_specified_cleanup(r);
DBG(f->r, "REQ[%X] end %s()", TO_ADDR(r),__func__);
return APR_SUCCESS;
}
else {
DBG(r, "REQ[%X] not convert content-type:[(null)]", TO_ADDR(r));
ap_pass_brigade(f->next, bb);
- chxj_specified_cleanup(r);
DBG(f->r, "REQ[%X] end %s()", TO_ADDR(r),__func__);
return APR_SUCCESS;
}
if (sts != OK) {
ERR(r, "REQ[%X] qrcode create failed.", TO_ADDR(r));
chxj_cookie_unlock(r, lock);
- chxj_specified_cleanup(r);
DBG(f->r, "REQ[%X] end %s()", TO_ADDR(r),__func__);
return sts;
}
(const char *)ctx->buffer,
(apr_size_t)ctx->len);
}
- chxj_specified_cleanup(r);
DBG(f->r, "REQ[%X] end %s()", TO_ADDR(r),__func__);
return rv;
}
apr_table_setn(r->headers_out, "Content-Length", "0");
s_add_no_cache_headers(r, entryp);
rv = pass_data_to_filter(f, (const char *)"", (apr_size_t)0);
- chxj_specified_cleanup(r);
DBG(f->r, "REQ[%X] end %s()", TO_ADDR(r), __func__);
return rv;
}
}
apr_brigade_destroy(bb);
- chxj_specified_cleanup(r);
DBG(f->r, "REQ[%X] end %s()", TO_ADDR(r), __func__);
return APR_SUCCESS;
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));
}
DBG(r, "REQ[%X] end %s()", TO_ADDR(r),__func__);
}
+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.