Hello
It has been noticed that when 'of' as returned by ngx_open_cached_file() is
not is_file, but otherwise valid and also not is_dir, then both the
ngx_http_flv_handler() and ngx_http_mp4_handler() functions will call
ngx_close_file() immediately. However, the ngx_pool_cleanup_file() will
still be called, leading to a duplicate ngx_close_file() being performed.
It seems that these calls to ngx_close_file() should just be removed; eg.,
with the following.
*--- a/src/http/modules/ngx_http_mp4_module.c*
*+++ b/src/http/modules/ngx_http_mp4_module.c*
@@ -522,10 +522,8 @@ ngx_http_mp4_handler(ngx_http_request_t *r)
if (!of.is_file) {
- if (ngx_close_file(of.fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", path.data);
- }
+ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, log, 0,
+ "%s: %V is not a file", __func__, &path);
return NGX_DECLINED;
}
*--- a/src/http/modules/ngx_http_flv_module.c*
*+++ b/src/http/modules/ngx_http_flv_module.c*
@@ -157,10 +157,8 @@ ngx_http_flv_handler(ngx_http_request_t *r)
if (!of.is_file) {
- if (ngx_close_file(of.fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", path.data);
- }
+ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, log, 0,
+ "%s: %V is not a file", __func__, &path);
return NGX_DECLINED;
}
TIA
Chris
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel