diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2020-10-19 23:31:02 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-10-20 11:51:48 -0400 |
commit | 019c513819c829af038bdec93a7c4c0cb3f687b7 (patch) | |
tree | 8cca1510e5ac770dbcaacb4099b2cccf34b4e656 /src/mod_deflate.c | |
parent | 9078cc4ce8bb9c0313ad67e3e50fee6bb08bd091 (diff) | |
download | lighttpd-git-019c513819c829af038bdec93a7c4c0cb3f687b7.tar.gz |
[multiple] use http_chunk_append_file_ref()
use http_chunk_append_file_ref() and http_chunk_append_file_ref_range()
reduce resource usage (number of fds open) by reference counting open
fds to files served, and sharing the fd among FILE_CHUNKs in responses
Diffstat (limited to 'src/mod_deflate.c')
-rw-r--r-- | src/mod_deflate.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mod_deflate.c b/src/mod_deflate.c index 68a6c253..7ef1af0b 100644 --- a/src/mod_deflate.c +++ b/src/mod_deflate.c @@ -1533,9 +1533,7 @@ REQUEST_FUNC(mod_deflate_handle_response_start) { stat_cache_entry *sce = stat_cache_get_entry_open(tb, 1); if (NULL != sce) { chunkqueue_reset(&r->write_queue); - int fd = sce->fd >= 0 ? fdevent_dup_cloexec(sce->fd) : -1; - if (fd < 0 - || 0 != http_chunk_append_file_fd(r, tb, fd, sce->st.st_size)) + if (sce->fd < 0 || 0 != http_chunk_append_file_ref(r, sce)) return HANDLER_ERROR; if (light_btst(r->resp_htags, HTTP_HEADER_CONTENT_LENGTH)) http_header_response_unset(r, HTTP_HEADER_CONTENT_LENGTH, |