Repository: trafficserver
Updated Branches:
  refs/heads/6.0.x af8b01153 -> 64a86b283


TS-3897: Getting 404s with regex_map

(cherry picked from commit 6125d24f0d2c849bf273ee0935cd5939fa5f34a1)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/64a86b28
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/64a86b28
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/64a86b28

Branch: refs/heads/6.0.x
Commit: 64a86b2832a463b60ba9f8990f85569829dd3128
Parents: af8b011
Author: Bryan Call <[email protected]>
Authored: Thu Sep 10 09:14:24 2015 -0700
Committer: Bryan Call <[email protected]>
Committed: Thu Sep 10 09:15:17 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/64a86b28/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 
&regex_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 
&regex_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;
     }
   }
 

Reply via email to