]> granicus.if.org Git - apache/commitdiff
Save a few cycles.
authorChristophe Jaillet <jailletc36@apache.org>
Fri, 3 Aug 2018 17:22:57 +0000 (17:22 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Fri, 3 Aug 2018 17:22:57 +0000 (17:22 +0000)
There is no need to check the first bytes, they are known to be "bytes ".

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837388 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/main/mod_dav.c

index a2127b11bed55ad167cd50da168ab2e28fb1d37b..1f26adb666080ed23c9c0c474294f91c99165277 100644 (file)
@@ -821,8 +821,8 @@ static int dav_parse_range(request_rec *r,
 
     range = apr_pstrdup(r->pool, range_c);
     if (ap_cstr_casecmpn(range, "bytes ", 6) != 0
-        || (dash = ap_strchr(range, '-')) == NULL
-        || (slash = ap_strchr(range, '/')) == NULL) {
+        || (dash = ap_strchr(range + 6, '-')) == NULL
+        || (slash = ap_strchr(range + 6, '/')) == NULL) {
         /* malformed header */
         return -1;
     }