2 * Copyright (C) 2005-2011 Atsushi Konno All rights reserved.
3 * Copyright (C) 2005 QSDN,Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include "chxj_apply_convrule.h"
20 static int s_apply_rule(request_rec *r, chxjconvrule_entry *pp);
23 chxj_apply_convrule(request_rec *r, apr_array_header_t *convrules)
25 chxjconvrule_entry *entries;
26 chxjconvrule_entry *pp;
33 entries = (chxjconvrule_entry *)convrules->elts;
34 for (ii = 0; ii < convrules->nelts; ii++) {
39 if (s_apply_rule(r, pp))
46 s_apply_rule(request_rec *r, chxjconvrule_entry *pp)
50 ap_regmatch_t regmatch[AP_MAX_REG_MATCH];
54 DBG(r,"REQ[%X] convert rule pattern=[%s] uri=[%s]", TO_ADDR(r), pp->pattern, uri);
56 rtn = ap_regexec((const ap_regex_t *)pp->regexp, uri, AP_MAX_REG_MATCH, (ap_regmatch_t *)regmatch, 0);
59 if (pp->flags & CONVRULE_FLAG_NOTMATCH) {
66 if (!(pp->flags & CONVRULE_FLAG_NOTMATCH)) {