}
if (start >= r->headers_out.content_length_n) {
- return NGX_HTTP_RANGE_NOT_SATISFIABLE;
+ goto skip;
}
while (*p == ' ') { p++; }
}
if (start > end) {
- return NGX_HTTP_RANGE_NOT_SATISFIABLE;
+ goto skip;
}
if (end >= r->headers_out.content_length_n) {
- /*
- * Download Accelerator sends the last byte position
- * that equals to the file length
- */
end = r->headers_out.content_length_n;
} else {
size += end - start;
+ skip:
+
if (*p++ != ',') {
break;
}
}
+ if (ctx->ranges.nelts == 0) {
+ return NGX_HTTP_RANGE_NOT_SATISFIABLE;
+ }
+
if (size > r->headers_out.content_length_n) {
return NGX_DECLINED;
}