- apply_convrule is called in two or more useless times.
};
struct mod_chxj_req_config_t {
- char *user_agent;
- device_table *spec;
- ap_filter_t *f;
+ char *user_agent;
+ device_table *spec;
+ ap_filter_t *f;
+ chxjconvrule_entry *entryp;
};
#define IS_COOKIE_STORE_DBM(X) ((X) == COOKIE_STORE_TYPE_DBM)
char *old_cookie_id;
char *store_string;
mod_chxj_config *dconf;
+ mod_chxj_req_config *req_conf;
chxjconvrule_entry *entryp;
apr_table_t *new_cookie_table;
int has_cookie = 0;
has_refer = 0;
dconf = chxj_get_module_config(r->per_dir_config, &chxj_module);
- entryp = chxj_apply_convrule(r, dconf->convrules);
+ req_conf = chxj_get_module_config(r->request_config, &chxj_module);
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (req_conf->user_agent) {
+ entryp = req_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, dconf->convrules);
+ }
if (! entryp) {
DBG(r,"REQ[%X] end %s() no pattern",TO_ADDR(r),__func__);
return NULL;
apr_table_entry_t *hentryp;
char *store_string;
mod_chxj_config *dconf;
+ mod_chxj_req_config *req_conf;
chxjconvrule_entry *entryp;
cookie_t *cookie;
cookie->cookie_id = NULL;
dconf = chxj_get_module_config(r->per_dir_config, &chxj_module);
- entryp = chxj_apply_convrule(r, dconf->convrules);
+ req_conf = chxj_get_module_config(r->request_config, &chxj_module);
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (req_conf->user_agent) {
+ entryp = req_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, dconf->convrules);
+ }
if (! entryp) {
DBG(r,"REQ[%X] no pattern",TO_ADDR(r));
DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
chxj_load_cookie(request_rec *r, char *cookie_id)
{
mod_chxj_config *dconf;
+ mod_chxj_req_config *req_conf;
chxjconvrule_entry *entryp;
cookie_t *cookie;
apr_table_t *load_cookie_table;
dconf = chxj_get_module_config(r->per_dir_config, &chxj_module);
- entryp = chxj_apply_convrule(r, dconf->convrules);
+ req_conf = chxj_get_module_config(r->request_config, &chxj_module);
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (req_conf->user_agent) {
+ entryp = req_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, dconf->convrules);
+ }
if (! entryp) {
DBG(r,"REQ[%X] pattern", TO_ADDR(r));
DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
apr_size_t ilen;
apr_size_t olen;
mod_chxj_config *dconf;
+ mod_chxj_req_config *req_conf;
chxjconvrule_entry *entryp;
apr_pool_t *pool;
return (char *)apr_pstrdup(r->pool, "");
}
- entryp = chxj_apply_convrule(r, dconf->convrules);
+ req_conf = chxj_get_module_config(r->request_config, &chxj_module);
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (req_conf->user_agent) {
+ entryp = req_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, dconf->convrules);
+ }
if (entryp->encoding == NULL) {
DBG(r,"REQ[%X] none encoding.", TO_ADDR(r));
DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
apr_size_t ilen;
apr_size_t olen;
mod_chxj_config *dconf;
+ mod_chxj_req_config *req_conf;
chxjconvrule_entry *entryp;
DBG(r,"REQ[%X] start %s()",TO_ADDR(r),__func__);
return (char*)src;
}
- entryp = chxj_apply_convrule(r, dconf->convrules);
+ req_conf = chxj_get_module_config(r->request_config, &chxj_module);
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (req_conf->user_agent) {
+ entryp = req_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, dconf->convrules);
+ }
if (! entryp->encoding) {
DBG(r,"REQ[%X] none encoding.",TO_ADDR(r));
DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
chxj_img_conv_format_handler(request_rec *r)
{
mod_chxj_config *conf;
+ mod_chxj_req_config *req_conf;
query_string_param_t *qsp;
char *user_agent;
device_table *spec;
qsp = s_get_query_string_param(r);
conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
+ req_conf = chxj_get_module_config(r->request_config, &chxj_module);
if (conf == NULL) {
DBG(r,"REQ[%X] conf is null",TO_ADDR(r));
DBG(r,"REQ[%X] end %s()",TO_ADDR(r),__func__);
user_agent = apr_pstrdup(r->pool, qsp->user_agent);
}
else {
- entryp = chxj_apply_convrule(r, conf->convrules);
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (req_conf->user_agent) {
+ entryp = req_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, conf->convrules);
+ }
if (entryp && entryp->user_agent) {
user_agent = (char*)apr_table_get(r->headers_in, CHXJ_HTTP_USER_AGENT);
}
if (qsp->ua_flag == UA_IGN)
spec = &v_ignore_spec;
else {
- mod_chxj_req_config *request_conf = chxj_get_module_config(r->request_config, &chxj_module);
- if (request_conf->user_agent
+ if (req_conf->user_agent
&& user_agent
- && strcmp(request_conf->user_agent, user_agent) != 0) {
+ && strcmp(req_conf->user_agent, user_agent) != 0) {
spec = chxj_specified_device(r, user_agent);
}
else {
- spec = request_conf->spec;
+ spec = req_conf->spec;
}
}
return NULL;
}
+ mod_chxj_req_config *req_conf = chxj_get_module_config(r->request_config, &chxj_module);
/*--------------------------------------------------------------------------*/
/* User-Agent to spec */
/*--------------------------------------------------------------------------*/
user_agent = apr_pstrdup(r->pool, qsp->user_agent);
}
else {
- entryp = chxj_apply_convrule(r, conf->convrules);
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (req_conf->user_agent) {
+ entryp = req_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, conf->convrules);
+ }
if (entryp && entryp->user_agent) {
user_agent = (char*)apr_table_get(r->headers_in, CHXJ_HTTP_USER_AGENT);
}
if (qsp->ua_flag == UA_IGN)
spec = &v_ignore_spec;
else {
- mod_chxj_req_config *request_conf = chxj_get_module_config(r->request_config, &chxj_module);
- if (request_conf->user_agent
+ if (req_conf->user_agent
&& user_agent
- && strcmp(request_conf->user_agent, user_agent) != 0) {
+ && strcmp(req_conf->user_agent, user_agent) != 0) {
spec = chxj_specified_device(r, user_agent);
}
else {
- spec = request_conf->spec;
+ spec = req_conf->spec;
}
}
request_conf = (mod_chxj_req_config *)chxj_get_module_config(r->request_config, &chxj_module);
if (!request_conf) {
request_conf = apr_palloc(r->pool, sizeof(mod_chxj_req_config));
- request_conf->spec = NULL;
+ request_conf->spec = NULL;
request_conf->user_agent = NULL;
- request_conf->f = NULL;
+ request_conf->f = NULL;
+ request_conf->entryp = NULL;
chxj_set_module_config(r->request_config, &chxj_module, request_conf);
}
dconf = chxj_get_module_config(r->per_dir_config, &chxj_module);
case CHXJ_SPEC_Hdml:
case CHXJ_SPEC_Jhtml:
case CHXJ_SPEC_Jxhtml:
- entryp = chxj_apply_convrule(r, dconf->convrules);
+ request_conf->entryp = entryp = chxj_apply_convrule(r, dconf->convrules);
if (dconf->image != CHXJ_IMG_ON) {
if (! entryp) {
DBG(r, "REQ[%X] end %s() (no pattern)", TO_ADDR(r), __func__);
request_conf = chxj_get_module_config(r->request_config, &chxj_module);
- entryp = chxj_apply_convrule(r, dconf->convrules);
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (request_conf->user_agent) {
+ entryp = request_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, dconf->convrules);
+ }
if (!entryp
|| ( !(entryp->action & CONVRULE_ENGINE_ON_BIT)
else {
spec = request_conf->spec;
}
- entryp = chxj_apply_convrule(r, dconf->convrules);
+
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (request_conf->user_agent) {
+ entryp = request_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, dconf->convrules);
+ }
post_data = apr_pstrdup(pool, "");
if (ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK) == OK) {
else {
spec = req_conf->spec;
}
- entryp = chxj_apply_convrule(r, dconf->convrules);
+ req_conf = chxj_get_module_config(r->request_config, &chxj_module);
+ /*-------------------------------------------------------------------------*/
+ /* already setup entryp if request_conf->user_agent is not null */
+ /*-------------------------------------------------------------------------*/
+ if (req_conf->user_agent) {
+ entryp = req_conf->entryp;
+ }
+ else {
+ entryp = chxj_apply_convrule(r, dconf->convrules);
+ }
if (!entryp && dconf->image != CHXJ_IMG_ON) {
DBG(r, "REQ[%X] entryp is NULL and ChxjImageEngine Off", TO_ADDR(r));
DBG(r, "REQ[%X] end %s()", TO_ADDR(r),__func__);