~titusx/nginx/mainline

Viewing all changes in revision 6557.

  • Committer: Maxim Dounin
  • Date: 2019-05-13 19:44:02 UTC
  • Revision ID: git-v1:ce0f35317e16c85c1ccae8f3a0a1d6f2426b2e78
Range filter: fixed loss of incoming chain links.

Filters are not allowed to change incoming chain links, and should allocate
their own links if any modifications are needed.  Nevertheless
ngx_http_range_singlepart_body() modified incoming chain links in some
cases, notably at the end of the requested range.

No problems caused by this are currently known, mostly because of
limited number of possible modifications and the position of the range
body filter in the filter chain.  Though this behaviour is clearly incorrect
and tests demonstrate that it can at least cause some proxy buffers being
lost when using proxy_force_ranges, leading to less effective handling
of responses.

Fix is to always allocate new chain links in ngx_http_range_singlepart_body().
Links are explicitly freed to ensure constant memory usage with long-lived
requests.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: