mirror of https://github.com/nginx/nginx
Merge 4f96f3f61b into 7c2524a692
This commit is contained in:
commit
e04a86f368
|
|
@ -272,7 +272,7 @@ ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx,
|
||||||
{
|
{
|
||||||
u_char *p;
|
u_char *p;
|
||||||
off_t start, end, size, content_length, cutoff,
|
off_t start, end, size, content_length, cutoff,
|
||||||
cutlim;
|
cutlim, multirange_boundary_size;
|
||||||
ngx_uint_t suffix;
|
ngx_uint_t suffix;
|
||||||
ngx_http_range_t *range;
|
ngx_http_range_t *range;
|
||||||
ngx_http_range_filter_ctx_t *mctx;
|
ngx_http_range_filter_ctx_t *mctx;
|
||||||
|
|
@ -401,6 +401,18 @@ ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx,
|
||||||
return NGX_HTTP_RANGE_NOT_SATISFIABLE;
|
return NGX_HTTP_RANGE_NOT_SATISFIABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctx->ranges.nelts > 1) {
|
||||||
|
multirange_boundary_size = sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN
|
||||||
|
+ sizeof(CRLF "Content-Type: ") - 1 + r->headers_out.content_type.len
|
||||||
|
+ sizeof(CRLF "Content-Range: bytes ") - 1;
|
||||||
|
|
||||||
|
size += multirange_boundary_size * ctx->ranges.nelts;
|
||||||
|
|
||||||
|
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
|
||||||
|
"multirange: ranges total size:%O, content length: %O",
|
||||||
|
size, content_length);
|
||||||
|
}
|
||||||
|
|
||||||
if (size > content_length) {
|
if (size > content_length) {
|
||||||
return NGX_DECLINED;
|
return NGX_DECLINED;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue