Repository: trafficserver Updated Branches: refs/heads/master cd19855fb -> 6125d24f0
TS-3897: Getting 404s with regex_map Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6125d24f Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6125d24f Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6125d24f Branch: refs/heads/master Commit: 6125d24f0d2c849bf273ee0935cd5939fa5f34a1 Parents: cd19855 Author: Bryan Call <[email protected]> Authored: Thu Sep 10 09:14:24 2015 -0700 Committer: Bryan Call <[email protected]> Committed: Thu Sep 10 09:14:24 2015 -0700 ---------------------------------------------------------------------- proxy/http/remap/UrlRewrite.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6125d24f/proxy/http/remap/UrlRewrite.cc ---------------------------------------------------------------------- diff --git a/proxy/http/remap/UrlRewrite.cc b/proxy/http/remap/UrlRewrite.cc index 422cda3..0e3af26 100644 --- a/proxy/http/remap/UrlRewrite.cc +++ b/proxy/http/remap/UrlRewrite.cc @@ -896,7 +896,7 @@ UrlRewrite::_regexMappingLookup(RegexMappingList ®ex_mappings, URL *request_u int matches_info[MAX_REGEX_SUBS * 3]; int match_result = list_iter->regular_expression.exec(request_host, request_host_len, matches_info, countof(matches_info)); - if (match_result > 0) { + if (match_result == true) { Debug("url_rewrite_regex", "Request URL host [%.*s] matched regex in mapping of rank %d " "with %d possible substitutions", request_host_len, request_host, reg_map_rank, match_result); @@ -915,12 +915,9 @@ UrlRewrite::_regexMappingLookup(RegexMappingList ®ex_mappings, URL *request_u Debug("url_rewrite_regex", "Expanded toURL to [%.*s]", expanded_url->length_get(), expanded_url->string_get_ref()); retval = true; break; - } else if (match_result == PCRE_ERROR_NOMATCH) { + } else { Debug("url_rewrite_regex", "Request URL host [%.*s] did NOT match regex in mapping of rank %d", request_host_len, request_host, reg_map_rank); - } else { - Warning("pcre_exec() failed with error code %d", match_result); - break; } }
