comparison src/http/modules/ngx_http_mp4_module.c @ 8124:f5515e727656

Fixed "zero size buf" alerts with subrequests. Since 4611:2b6cb7528409 responses from the gzip static, flv, and mp4 modules can be used with subrequests, though empty files were not properly handled. Empty gzipped, flv, and mp4 files thus resulted in "zero size buf in output" alerts. While valid corresponding files are not expected to be empty, such files shouldn't result in alerts. Fix is to set b->sync on such empty subrequest responses, similarly to what ngx_http_send_special() does. Additionally, the static module, the ngx_http_send_response() function, and file cache are modified to do the same instead of not sending the response body at all in such cases, since not sending the response body at all is believed to be at least questionable, and might break various filters which do not expect such behaviour.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 28 Jan 2023 05:23:33 +0300
parents 4032c1bdfa14
children
comparison
equal deleted inserted replaced
8123:1c3b78d7cdc9 8124:f5515e727656
712 b->file_last = of.size; 712 b->file_last = of.size;
713 713
714 b->in_file = b->file_last ? 1 : 0; 714 b->in_file = b->file_last ? 1 : 0;
715 b->last_buf = (r == r->main) ? 1 : 0; 715 b->last_buf = (r == r->main) ? 1 : 0;
716 b->last_in_chain = 1; 716 b->last_in_chain = 1;
717 b->sync = (b->last_buf || b->in_file) ? 0 : 1;
717 718
718 b->file->fd = of.fd; 719 b->file->fd = of.fd;
719 b->file->name = path; 720 b->file->name = path;
720 b->file->log = log; 721 b->file->log = log;
721 b->file->directio = of.is_directio; 722 b->file->directio = of.is_directio;