aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_range_filter_module.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c
index c0a835c3e..6b45e2bea 100644
--- a/src/http/modules/ngx_http_range_filter_module.c
+++ b/src/http/modules/ngx_http_range_filter_module.c
@@ -264,7 +264,7 @@ ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx)
}
if (start >= r->headers_out.content_length_n) {
- return NGX_HTTP_RANGE_NOT_SATISFIABLE;
+ goto skip;
}
while (*p == ' ') { p++; }
@@ -299,14 +299,10 @@ ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx)
}
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 {
@@ -325,11 +321,17 @@ ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx)
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;
}