summaryrefslogtreecommitdiff
path: root/src/chunk.h
Commit message (Collapse)AuthorAgeFilesLines
* [core] chunk_file_pread() to wrap pread()Glenn Strauss2022-02-191-0/+2
|
* [multiple] shared code for struct chunk and mmapGlenn Strauss2022-02-191-9/+57
| | | | | | | | | | | | | | | | | | | 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.)
* [core] 'struct log_error_st' -> 'log_error_st'Glenn Strauss2021-10-291-13/+10
| | | | | | | | | | | 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
* [core] clean up fdlog_st and log_error_st declsGlenn Strauss2021-10-291-1/+2
| | | | | | | | | | | 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
* [core] expose chunkqueue_remove_empty_chunks()Glenn Strauss2021-10-271-0/+3
| | | | | expose chunkqueue_remove_empty_chunks() for use in error recovery when aborting a chunkqueue_append_buffer_open*()
* [multiple] __attribute_nonnull__ now takes paramsGlenn Strauss2021-10-051-3/+3
| | | | | | | | | 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
* [core] splice() data from backends to tempfilesGlenn Strauss2021-09-301-0/+9
| | | | | | | | | 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())
* [core] improve chunk buffer reuse from backendsGlenn Strauss2021-09-241-0/+3
| | | | improve oversized chunk buffer reuse from backends
* [multiple] de-dup file and piped loggers (fixes #3101)Glenn Strauss2021-09-131-1/+2
| | | | | | | | 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
* [multiple] quiet coverity warningsGlenn Strauss2021-09-091-0/+4
|
* [core] remove server.upload-temp-file-size limitGlenn Strauss2021-09-081-1/+0
| | | | | | 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)
* [core] mark some chunk.h funcs attr coldGlenn Strauss2021-04-021-0/+8
|
* [core] chunkqueue_append_cq_range()Glenn Strauss2021-02-251-0/+1
|
* [multiple] chunkqueue_write_chunk()Glenn Strauss2020-12-271-0/+3
| | | | | | | | | | | | 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)
* [core] reuse large mem chunks (fix mem usage) (fixes #3033)Glenn Strauss2020-12-241-0/+2
| | | | | | | | | | | | (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
* [core] FILE_CHUNK can hold stat_cache_entry refGlenn Strauss2020-10-201-0/+2
|
* [multiple] remove chunk file.start memberGlenn Strauss2020-10-191-5/+4
| | | | | | 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
* [core] reuse chunkqueue_compact_mem*()Glenn Strauss2020-10-191-0/+1
|
* [multiple] inline chunkqueue where always alloc'dGlenn Strauss2020-10-111-1/+3
| | | | | | inline struct chunkqueue where always allocated in other structs (memory locality)
* [core] chunkqueue_{peek,read}_data(), squashGlenn Strauss2020-10-111-0/+5
| | | | | chunkqueue_peek_data(), chunkqueue_read_data(), chunkqueue_read_squash() shared code for chunkqueue manipulation
* [multiple] inline chunkqueue_length()Glenn Strauss2020-10-111-1/+4
|
* [mod_ssi] update chunk after shell output redirectGlenn Strauss2020-10-111-0/+1
| | | | | chunkqueue_update_file() to update size of file chunk after redirecting shell output to file fd
* [core] defer optimization to read small filesGlenn Strauss2020-10-111-0/+2
| | | | | | | 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
* [core] disperse settings.h to appropriate headersGlenn Strauss2020-08-101-0/+4
|
* [core] C99 restrict on some base funcsGlenn Strauss2020-07-081-13/+13
| | | | buffer.[ch], chunk.[ch], request.[ch], sock_addr.[ch]
* [core] move addtl request-specific struct membersGlenn Strauss2020-07-081-1/+1
|
* [core] read up-to fixed size chunk before fionreadGlenn Strauss2020-07-081-1/+1
|
* [core] create http chunk header on the stackGlenn Strauss2020-07-081-2/+2
| | | | streamline code in http_chunk.c
* [multiple] prefer (connection *) to (srv *)Glenn Strauss2020-07-081-5/+5
| | | | | | | | 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)
* [core] use config_plugin_values_init()Glenn Strauss2020-07-081-3/+3
|
* [core] __attribute_returns_nonnull__Glenn Strauss2020-02-241-0/+14
|
* [core] chunkqueue_compact_mem()Glenn Strauss2020-02-241-0/+2
|
* [core] mark some more funcs w/ __attribute_pure__Glenn Strauss2019-06-061-0/+3
|
* [core] off_t upload_temp_file_sizeGlenn Strauss2019-03-161-2/+3
|
* [multiple] reduce initial buffer sz if large POST (fixes #2922)Glenn Strauss2018-12-121-0/+1
| | | | | | | | | | | | 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
* [core] server.chunkqueue-chunk-sz = 4096Glenn Strauss2018-11-171-0/+1
| | | | | | | | | | 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.
* [multiple] perf: simplify chunkqueue_get_memory()Glenn Strauss2018-11-121-8/+5
|
* [core] perf: chunkqueue buffers already sized upGlenn Strauss2018-11-121-0/+2
| | | | | provide new interface for sizing to even larger if very large request (chunkqueue_prepend_buffer_open_sz())
* [multiple] better packing of struct chunkGlenn Strauss2018-11-121-12/+9
| | | | | remove c->file.name previous commit modified c->file.name to share buffer with c->mem
* [core] perf: chunk.c chunk poolGlenn Strauss2018-11-121-3/+6
| | | | | reuse chunks across chunkqueues; remove cq->unused, cq->unused_chunks reuse same buffer c->mem and c->file.name in chunk
* [core] perf: append response directly into write qGlenn Strauss2018-10-281-0/+2
| | | | prepend non-dynamic response directly into write queue chunkqueue
* [core] perf: prepend headers directly into write qGlenn Strauss2018-10-271-1/+3
| | | | prepend response headers directly into write queue chunkqueue
* [core] inline chunkqueue_is_empty()Glenn Strauss2017-10-091-1/+4
|
* [core] workaround for AIX mmap defineGlenn Strauss2017-08-081-0/+4
| | | | | | | | | 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
* [core] initialize globals at top of main()Glenn Strauss2017-01-311-0/+1
| | | | initialize globals (including file-scoped static globals) at top of main
* [core] move network_open_file_chunk() to chunk.cGlenn Strauss2017-01-141-0/+2
| | | | | move network_open_file_chunk() to chunk.c:chunkqueue_open_file_chunk() for reuse from modules
* [core] set chunkqueue tempdirs at startupGlenn Strauss2016-07-281-1/+1
| | | | | | 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.
* chunkqueue_append_chunkqueue()Glenn Strauss2016-06-211-0/+1
| | | | (simpler than chunkqueue_steal() for transferring entire chunkqueue)
* [core] buffer large responses to tempfiles (fixes #758, fixes #760, fixes ↵Glenn Strauss2016-06-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | #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
* [core] retry tempdirs on partial write, ENOSPC (fixes #2588)Glenn Strauss2016-04-181-0/+1
| | | | | | | | | | | | | 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