]> git.kaiwu.me - nginx.git/commit
Fixed double close of non-regular files in flv and mp4.
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 11 Dec 2020 10:42:07 +0000 (13:42 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 11 Dec 2020 10:42:07 +0000 (13:42 +0300)
commitb138e263959778bb4ba73243106d2c5f98a2c927
tree7fc631c0e8f3f1bf865386db59e1be10498ad055
parent2e94c81b0bf1d8e695d9afd074c79520aa03081a
Fixed double close of non-regular files in flv and mp4.

With introduction of open_file_cache in 1454:f497ed7682a7, opening a file
with ngx_open_cached_file() automatically adds a cleanup handler to close
the file.  As such, calling ngx_close_file() directly for non-regular files
is no longer needed and will result in duplicate close() call.

In 1454:f497ed7682a7 ngx_close_file() call for non-regular files was removed
in the static module, but wasn't in the flv module.  And the resulting
incorrect code was later copied to the mp4 module.  Fix is to remove the
ngx_close_file() call from both modules.

Reported by Chris Newton.
src/http/modules/ngx_http_flv_module.c
src/http/modules/ngx_http_mp4_module.c