You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2018/03/08 23:23:30 UTC

svn commit: r1826289 - /httpd/httpd/trunk/modules/proxy/proxy_util.c

Author: ylavic
Date: Thu Mar  8 23:23:30 2018
New Revision: 1826289

URL: http://svn.apache.org/viewvc?rev=1826289&view=rev
Log:
Follow up to r1609680: simpler/faster ap_proxy_strcmp_ematch().

No functional change.

Modified:
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1826289&r1=1826288&r2=1826289&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Thu Mar  8 23:23:30 2018
@@ -1502,11 +1502,13 @@ static int ap_proxy_strcmp_ematch(const
     apr_size_t x, y;
 
     for (x = 0, y = 0; expected[y]; ++y, ++x) {
-        if ((!str[x]) && (expected[y] != '$' || !apr_isdigit(expected[y + 1])))
+        int backref = (expected[y] == '$' && apr_isdigit(expected[y + 1]));
+        if (!str[x] && !backref)
             return -1;
-        if (expected[y] == '$' && apr_isdigit(expected[y + 1])) {
-            while (expected[y] == '$' && apr_isdigit(expected[y + 1]))
+        if (backref) {
+            do {
                 y += 2;
+            } while (expected[y] == '$' && apr_isdigit(expected[y + 1]));
             if (!expected[y])
                 return 0;
             while (str[x]) {