diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-08-30 13:01:55 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-08-30 13:01:55 +0000 |
commit | 451df22b3f07d4e11ea8b32cc932630ae383d280 (patch) | |
tree | 7afb6fc9dfd75aac08b5fc8a216aa89d53f53ffb /src | |
parent | 584703b84a3dff36e7127c555248f9d024179f06 (diff) | |
download | nginx-451df22b3f07d4e11ea8b32cc932630ae383d280.tar.gz nginx-451df22b3f07d4e11ea8b32cc932630ae383d280.zip |
Now unsatisfiable ranges are processed according to RFC 2616.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_range_filter_module.c | 14 |
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; } |