diff options
author | Christophe Jaillet <jailletc36@apache.org> | 2020-11-14 13:46:38 +0100 |
---|---|---|
committer | Christophe Jaillet <jailletc36@apache.org> | 2020-11-14 13:46:38 +0100 |
commit | b2b57c3183430a427ecef986e560d8d25db144f1 (patch) | |
tree | 3cda9a1adad1c379fbdd16bd1ea4fb5d3483e5a4 /modules/mappers/mod_rewrite.c | |
parent | Explain limitation of UnDefine syntax as already noted in Define. (diff) | |
download | apache2-b2b57c3183430a427ecef986e560d8d25db144f1.tar.xz apache2-b2b57c3183430a427ecef986e560d8d25db144f1.zip |
Save a few cycles.
'is_absolute_uri()' returns the length of the prefix, so there is no need to scan
these bytes when looking for a '?' character
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1883421 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers/mod_rewrite.c')
-rw-r--r-- | modules/mappers/mod_rewrite.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 5a38ad03e0..8ce84f44df 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -797,23 +797,23 @@ static void splitout_queryargs(request_rec *r, int qsappend, int qsdiscard, int qslast) { char *q; - int split; + int split, skip; /* don't touch, unless it's a scheme for which a query string makes sense. * See RFC 1738 and RFC 2368. */ - if (is_absolute_uri(r->filename, &split) + if ((skip = is_absolute_uri(r->filename, &split)) && !split) { r->args = NULL; /* forget the query that's still flying around */ return; } - if ( qsdiscard ) { + if (qsdiscard) { r->args = NULL; /* Discard query string */ rewritelog(r, 2, NULL, "discarding query string"); } - q = qslast ? ap_strrchr(r->filename, '?') : ap_strchr(r->filename, '?'); + q = qslast ? ap_strrchr(r->filename + skip, '?') : ap_strchr(r->filename + skip, '?'); if (q != NULL) { char *olduri; @@ -844,8 +844,6 @@ static void splitout_queryargs(request_rec *r, int qsappend, int qsdiscard, rewritelog(r, 3, NULL, "split uri=%s -> uri=%s, args=%s", olduri, r->filename, r->args ? r->args : "<none>"); } - - return; } /* |