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

svn commit: r1837388 - /httpd/httpd/trunk/modules/dav/main/mod_dav.c

Author: jailletc36
Date: Fri Aug  3 17:22:57 2018
New Revision: 1837388

URL: http://svn.apache.org/viewvc?rev=1837388&view=rev
Log:
Save a few cycles.
There is no need to check the first bytes, they are known to be "bytes ".

Modified:
    httpd/httpd/trunk/modules/dav/main/mod_dav.c

Modified: httpd/httpd/trunk/modules/dav/main/mod_dav.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/main/mod_dav.c?rev=1837388&r1=1837387&r2=1837388&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/main/mod_dav.c (original)
+++ httpd/httpd/trunk/modules/dav/main/mod_dav.c Fri Aug  3 17:22:57 2018
@@ -821,8 +821,8 @@ static int dav_parse_range(request_rec *
 
     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;
     }