Commit b4201233 authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

count ranges by simply counting commas


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1161790 13f79535-47bb-0310-9956-ffa450edef68
parent 389a0fb1
Loading
Loading
Loading
Loading
+8 −11
Changes for modules/http/byterange_filter.c: 8 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -468,7 +468,7 @@ static int ap_set_byterange(request_rec *r)
    const char *if_range;
    const char *match;
    const char *ct;
    int num_ranges;
    int num_ranges = 1;

    if (r->assbackwards) {
        return 0;
@@ -521,17 +521,14 @@ static int ap_set_byterange(request_rec *r)
        }
    }

    if (!ap_strchr_c(range, ',')) {
        /* a single range */
        num_ranges = 1;
    }
    else {
        /* a multiple range */
        num_ranges = 2;
    }

    range += 6;
    r->status = HTTP_PARTIAL_CONTENT;
    r->range = range + 6;
    r->range = range;
    while (*range) {
        if (*range == ',')
            num_ranges++;
        range++;
    }

    return num_ranges;
}