| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
_WIN32 __declspec(dllexport) on mod_*_plugin_init()
|
|
|
|
|
|
|
|
| |
_WIN32 disable deflate.cache-dir due to NTFS filesystem limitations
deflate.cache-dir renames files into place and this fails if the
files are open (source or destination). deflate.cache-dir would
have to be reworked to fail gracefully and continue serving request
if the final rename fails.
|
|
|
|
| |
(selective implementations; not complete)
|
|
|
|
|
|
|
| |
no lstat()
no S_IFSOCK
no S_ISSOCK()
...
|
|
|
|
|
|
|
|
|
|
|
| |
adjustments to compile warnings-free with recent clang changes that
warn about potential behavior change for non-prototypes, including
generic function pointers e.g. int(*)()
x-ref:
https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2432.pdf
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2841.htm
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(thx schaschlik)
RFC 2616 3.5 Content Codings
https://www.rfc-editor.org/rfc/rfc2616#section-3.5
deflate
The "zlib" format defined in RFC 1950 [31] in combination with
the "deflate" compression mechanism described in RFC 1951 [29].
RFC 7230 4.2.2. Deflate Coding
https://www.rfc-editor.org/rfc/rfc7230#section-4.2.2
RFC 9110 8.4.1.2. Deflate Coding
https://datatracker.ietf.org/doc/html/rfc9110#section-8.4.1.2
The "deflate" coding is a "zlib" data format [RFC1950] containing a
"deflate" compressed data stream [RFC1951] that uses a combination of
the Lempel-Ziv (LZ77) compression algorithm and Huffman coding.
Note: Some non-conformant implementations send the "deflate"
compressed data without the zlib wrapper.
|
|
|
|
|
| |
employ ck_calloc(), ck_malloc() shared code to slightly reduce code size
(centralize the ck_assert() to check that memory allocation succeeded)
|
| |
|
|
|
|
|
|
| |
http_response_body_clear() clears body flags
r->resp_body_started
r->resp_body_finished
|
|
|
|
| |
skip deflate cache for Cache-Control 'private' or 'no-store' responses
|
|
|
|
|
|
|
|
|
|
|
| |
must use mmap MAP_SHARED for writes to modify file on disk
(MAP_PRIVATE does not modify underlying file on disk)
(thx flynn)
x-ref:
"gzip dynamic compression broken with source size bigger than 128k"
https://redmine.lighttpd.net/issues/3161
|
|
|
|
|
|
|
|
|
|
| |
translate MIME type "application/javascript" to "text/javascript"
(if required, type may still be overwritten by mod_setenv or mod_magnet)
x-ref:
"Updates to ECMAScript Media Types"
https://www.rfc-editor.org/rfc/rfc9239
|
| |
|
|
|
|
|
| |
x-ref:
https://www.ietf.org/id/draft-ietf-httpbis-safe-method-w-body-02.html
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
| |
wrap system os setjmp or compiler try/catch and access mmap inside
callback to protect against SIGBUS (or _WIN32 EXCEPTION_IN_PAGE_ERROR)
|
| |
|
| |
|
|
|
|
| |
mmap entire file to compress on 64-bit systems
|
|
|
|
|
|
|
|
|
|
|
|
| |
(thx meier22)
Bug in lighttpd 1.4.51 - lighttpd 1.4.64
x-ref:
"mod_deflate not returning 304 Not Modified for If-None-Match request"
https://redmine.lighttpd.net/issues/3143
"How to get 304 Not Modified - response with mod_deflate"
https://redmine.lighttpd.net/boards/2/topics/10253
|
|
|
|
| |
(no longer used; was used as temporary buffer)
|
|
|
|
|
|
|
|
|
|
| |
cast away signedness warning in request_check_hostname()
mod_gnutls https_add_ssl_client_entries crts allocated if crt_size != 0
(which is already checked earlier in routine)
report from FaceBook Infer static analysis tool (https://fbinfer.com/)
- quiet dead store warnings
- check return != NULL from allocation funcs
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
BROTLI_DEFAULT_QUALITY is 11, which may lead to a higher compression
ratio, but potentially at a cost of taking *many* multiples of the
time taken to compress at quality level 5.
x-ref:
https://almanac.httparchive.org/en/2020/compression#fig-3
https://blog.cloudflare.com/results-experimenting-brotli/
https://blogs.akamai.com/2016/02/understanding-brotlis-potential.html
https://expeditedsecurity.com/blog/nginx-brotli/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mechanism to define per-encoder params
parsed into structured data at startup
compression level is the initial target
deflate.params is a better solution to the deflate.compression-level,
which is a single range 1-9 that is overload and applied to all encoders
without any scaling, even though encoders might have different scales.
x-ref:
"ModDeflate questions (possibly some feature requests too)"
https://redmine.lighttpd.net/boards/2/topics/9786
|
|
|
|
|
|
|
|
|
|
| |
map deflate.compression-level to ZSTD_c_strategy as the current
enum for ZSTD_strategy is in the range 1 .. 9, which matches the
gzip compression level 1 .. 9 range
x-ref:
"ModDeflate questions (possibly some feature requests too)"
https://redmine.lighttpd.net/boards/2/topics/9786
|
|
|
|
|
|
|
|
|
| |
use deflate.allowed-encodings ordering as server preference list
when choosing an encoding from list in client request Accept header
x-ref:
"ModDeflate questions (possibly some feature requests too)"
https://redmine.lighttpd.net/boards/2/topics/9786
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot code paths.
Most (buffer *) used by lighttpd are not NULL, especially since buffers
were inlined into numerous larger structs such as request_st and chunk.
In the small number of instances where that is not the case, a NULL
check is often performed earlier in a function where that buffer is
later used with a buffer_* func. In the handful of cases that remained,
a NULL check was added, e.g. with r->http_host and r->conf.server_tag.
- check for empty strings at config time and set value to NULL if blank
string will be ignored at runtime; at runtime, simple pointer check
for NULL can be used to check for a value that has been set and is not
blank ("")
- use buffer_is_blank() instead of buffer_string_is_empty(),
and use buffer_is_unset() instead of buffer_is_empty(),
where buffer is known not to be NULL so that NULL check can be skipped
- use buffer_clen() instead of buffer_string_length() when buffer is
known not to be NULL (to avoid NULL check at runtime)
- use buffer_truncate() instead of buffer_string_set_length() to
truncate string, and use buffer_extend() to extend
Examples where buffer known not to be NULL:
- cpv->v.b from config_plugin_values_init is not NULL if T_CONFIG_BOOL
(though we might set it to NULL if buffer_is_blank(cpv->v.b))
- address of buffer is arg (&foo)
(compiler optimizer detects this in most, but not all, cases)
- buffer is checked for NULL earlier in func
- buffer is accessed in same scope without a NULL check (e.g. b->ptr)
internal behavior change:
callers must not pass a NULL buffer to some funcs.
- buffer_init_buffer() requires non-null args
- buffer_copy_buffer() requires non-null args
- buffer_append_string_buffer() requires non-null args
- buffer_string_space() requires non-null arg
|
| |
|
| |
|
|
|
|
| |
reduces the number of round-trips into some frequently-called routines
|
| |
|
| |
|
|
|
|
|
| |
ZSTD_compressStream2() was an "advanced API" (experimental; unstable)
in v1.3.x
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
more efficient implementation of HTTP ETag generation and comparison
modify dekhash() to take hash value to allow for incremental hashing
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
use large chunks since server blocks while compressing, anyway
(mod_deflate is not recommended for large files)
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
leverage simple cache of open file in stat_cache
(use stat_cache_get_entry_open())
future: reference count fd instead of dup()
(requires extending chunkqueue interfaces)
|
|
|
|
| |
(bug on master branch; never released)
|