| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
chunkqueue_chunk_file_view()
reduces size of struct chunk
use mmap with mod_deflate libdeflate, if mmap available,
even when lighttpd not built with --enable-mmap
avoid using mmap on temp files in chunkqueue (c->file.is_temp)
since pread() with a reasonable block size is typically as fast
or faster than mmap on files read sequentially and used only once,
especially when writing results to limited-size socket buffers
(and lighttpd temp files are, in most cases, by default about 1 MB)
(Exception: sometimes mmap is used for convenience or to fulfill
a requirement, e.g. one-shot libdeflate in mod_deflate)
(There are many factors which influence speed of mmap versus pread,
so this should not be construed as generic usage advice.)
|
|
|
|
|
|
|
|
|
|
|
| |
typedef redefinitions may cause issues with older compilers
(The intention behind the decls and defines were done to reduce the
number of unrelated lines modified for the transition to fdlog_st)
x-ref:
https://trac.macports.org/ticket/63667
https://github.com/macports/macports-ports/pull/12658
|
|
|
|
|
|
|
|
|
|
|
| |
typedef redefinitions may cause issues with older compilers
(The intention behind the decls and defines were done to reduce the
number of unrelated lines modified for the transition to fdlog_st)
x-ref:
https://trac.macports.org/ticket/63667
https://github.com/macports/macports-ports/pull/12658
|
|
|
|
|
| |
expose chunkqueue_remove_empty_chunks() for use in error recovery
when aborting a chunkqueue_append_buffer_open*()
|
|
|
|
|
|
|
|
|
| |
define __attribute_nonnull__(params) with params to match
recent changes in glibc development (targetting glibc 2.35 in Feb 2022)
x-ref:
new __attribute_nonnull__(params) conflicts with third-party
https://sourceware.org/bugzilla/show_bug.cgi?id=28425
|
|
|
|
|
|
|
|
|
| |
splice() data from backends to tempfiles (where splice() is available);
reduce copying data to userspace when writing data to tempfiles
Note: splice() on Linux returns EINVAL if target file has O_APPEND set
so lighttpd uses pwrite() (where available) when writing to tempfiles
(instead of lseek() + write(), or O_APPEND and write())
|
|
|
|
| |
improve oversized chunk buffer reuse from backends
|
|
|
|
|
|
|
|
| |
de-dup file and piped loggers for error logs and access logs
x-ref:
"RFE: de-dup file and piped loggers"
https://redmine.lighttpd.net/issues/3101
|
| |
|
|
|
|
|
|
| |
previously undocumented server.upload-temp-file-size in lighttpd 1.4.38
preceded introduction of lighttpd streaming options in lighttpd 1.4.40
(server.stream-request-body and server.stream-response-body)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
create API in chunk.[ch] for writing a chunk to an fd
(pull similar code from mod_cgi and mod_webdav)
This new API is intended for use on request body input, which is
written to size-limited temporary files controlled by lighttpd and
written to files or pipes.
(network_backend_write() is for writing chunkqueues to sockets)
|
|
|
|
|
|
|
|
|
|
|
|
| |
(thx flynn)
fix large memory usage for large file downloads from dynamic backends
reuse or release large memory chunks
x-ref:
"Memory Growth with PUT and full buffered streams"
https://redmine.lighttpd.net/issues/3033
|
| |
|
|
|
|
|
|
| |
c->offset is now offset into file
c->file.length is end of octets to send (end pos + 1)
c->file.length - c->offset is num of octets to send
|
| |
|
|
|
|
|
|
| |
inline struct chunkqueue where always allocated in other structs
(memory locality)
|
|
|
|
|
| |
chunkqueue_peek_data(), chunkqueue_read_data(), chunkqueue_read_squash()
shared code for chunkqueue manipulation
|
| |
|
|
|
|
|
| |
chunkqueue_update_file() to update size of file chunk after
redirecting shell output to file fd
|
|
|
|
|
|
|
| |
defer optimization to read small files into memory until after
response_start hooks have a chance to run, e.g. until after
mod_deflate chooses whether or not to serve file from compressed
cache, if deflate.cache-dir is configured
|
| |
|
|
|
|
| |
buffer.[ch], chunk.[ch], request.[ch], sock_addr.[ch]
|
| |
|
| |
|
|
|
|
| |
streamline code in http_chunk.c
|
|
|
|
|
|
|
|
| |
convert all log_error_write() to log_error() and pass (log_error_st *)
use con->errh in preference to srv->errh (even though currently same)
avoid passing (server *) when previously used only for logging (errh)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
reduce initial buffer size if large POST to backend stored in temp files
regression in lighttpd 1.4.52
(thx rgenoud)
x-ref:
"[regression] lighttpd gets killed after uploading a big file"
https://redmine.lighttpd.net/issues/2922
|
|
|
|
|
|
|
|
|
|
| |
server.chunkqueue-chunk-sz = 4096 (default)
Can be configured any integral value greater than 0.
Value is rounded up to next 1024 if not an even multiple of 1k.
Sites with large request or response headers may benefit from
an 8k or 16k chunk size. Embedded systems might choose to minimize
memory use by using a 1k chunk size.
|
| |
|
|
|
|
|
| |
provide new interface for sizing to even larger if very large request
(chunkqueue_prepend_buffer_open_sz())
|
|
|
|
|
| |
remove c->file.name
previous commit modified c->file.name to share buffer with c->mem
|
|
|
|
|
| |
reuse chunks across chunkqueues; remove cq->unused, cq->unused_chunks
reuse same buffer c->mem and c->file.name in chunk
|
|
|
|
| |
prepend non-dynamic response directly into write queue chunkqueue
|
|
|
|
| |
prepend response headers directly into write queue chunkqueue
|
| |
|
|
|
|
|
|
|
|
|
| |
AIX might #define mmap mmap64 and this conflicts with .mmap member
of struct chunk in chunk.h
x-ref:
".mmap in chunk.c on AIX 5.2"
https://redmine.lighttpd.net/boards/2/topics/7512?r=7513
|
|
|
|
| |
initialize globals (including file-scoped static globals) at top of main
|
|
|
|
|
| |
move network_open_file_chunk() to chunk.c:chunkqueue_open_file_chunk()
for reuse from modules
|
|
|
|
|
|
| |
If server.upload-dirs is not configured, then attempt to use TMPDIR
from the environment, if set, or else use /tmp. Warn at startup if
tempdirs are not present.
|
|
|
|
| |
(simpler than chunkqueue_steal() for transferring entire chunkqueue)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
#933, fixes #1387, #1283, fixes #2083)
This replaces buffering entire response in memory which might lead to
huge memory footprint and possibly to memory exhaustion.
use tempfiles of fixed size so disk space is freed as each file sent
update callers of http_chunk_append_mem() and http_chunk_append_buffer()
to handle failures when writing to tempfile.
x-ref:
"memory fragmentation leads to high memory usage after peaks"
https://redmine.lighttpd.net/issues/758
"Random crashing on FreeBSD 6.1"
https://redmine.lighttpd.net/issues/760
"lighty should buffer responses (after it grows above certain size) on disk"
https://redmine.lighttpd.net/issues/933
"Memory usage increases when proxy+ssl+large file"
https://redmine.lighttpd.net/issues/1283
"lighttpd+fastcgi memory problem"
https://redmine.lighttpd.net/issues/1387
"Excessive Memory usage with streamed files from PHP"
https://redmine.lighttpd.net/issues/2083
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous code would fail on partial write, EINTR, and ENOSPC.
Upon any of the above errors, this patch tries next tempdir in list,
if list of tempdirs provided by config option server.upload-dirs
x-ref:
"Problem when uploading large files"
https://redmine.lighttpd.net/issues/2588
github:
Closes #54
|