| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
employ ck_calloc(), ck_malloc() shared code to slightly reduce code size
(centralize the ck_assert() to check that memory allocation succeeded)
|
|
|
|
| |
employ ck_realloc_u32() shared code to slightly reduce code size
|
| |
|
| |
|
|
|
|
|
| |
(future: might rename plugin.c -> plugins.c since the functions
contained within are all plugins_*())
|
|
|
|
| |
no need to be allocated (buffer *)
|
|
|
|
|
| |
run plugin cleanup hooks in reverse to balance ctor/dtor-like plugin
behaviors
|
|
|
|
| |
mark some core code with attributes malloc, returns nonnull
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mod_compress was removed in lighttpd 1.4.56, subsumed by mod_deflate.
distros may package mod_deflate separately from the lighttpd package.
However, existing configurations may reference mod_compress.
lighttpd maps the reference from mod_compress to mod_deflate,
but after a system is upgraded to lighttpd 1.4.56 or later,
mod_compress may have been removed, and mod_deflate -- which
might be a separate package -- might not be installed.
lighttpd will still issue error trace about the missing mod_deflate
modules, as well as about the unrecognized configuration directives
(compress.* or deflate.*), but this will no longer be a fatal error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
hooks are run consecutively in http_response_prepare()
merge uri_raw before uri_clean to preserve existing ordering
|
| |
|
|
|
|
| |
reduces the number of round-trips into some frequently-called routines
|
|
|
|
| |
filter out modules duplicated in server.modules list
|
|
|
|
| |
rename connection_reset to handle_request_reset
|
|
|
|
|
|
|
|
|
|
| |
(expansion of buffer_string_lenth() inline function and CONST_BUF_LEN()
macro, which always check for NULL, appears to cause the analyzer to
believe that a pointer might be NULL in cases where it otherwise can
not be NULL)
x-ref:
http://clang-analyzer.llvm.org/faq.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NB: r->tmp_buf == srv->tmp_buf (pointer is copied for quicker access)
NB: request read and write chunkqueues currently point to connection
chunkqueues; per-request and per-connection chunkqueues are
not distinct from one another
con->read_queue == r->read_queue
con->write_queue == r->write_queue
NB: in the future, a separate connection config may be needed for
connection-level module hooks. Similarly, might need to have
per-request chunkqueues separate from per-connection chunkqueues.
Should probably also have a request_reset() which is distinct from
connection_reset().
|
|
|
|
| |
store pointer to module in handler_module instead of con->mode id
|
|
|
|
| |
(self-referential)
|
|
|
|
| |
rather than using srv->tmp_buf directly in code modifying temp buf (tb)
|
|
|
|
|
|
|
| |
use global rather than passing around (server *) just for that
li_itostrn() and li_utostrn() return string length
(rather than requiring subsequent strlen() to find length)
|
|
|
|
| |
(explicit (server *) not passed; available in con->srv)
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
| |
(do not bail if a handler returns something other than HANDLER_GO_ON)
(preserve fn signature for simplicity and compat with plugin_fn_data)
|
|
|
|
| |
(simpler for modules; less boilerplate to cut-n-paste)
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
put void *data (always used) as first member of struct plugin
add int nconfig member to PLUGIN_DATA
calloc() inits p->data to NULL
|
|
|
|
| |
(instead of value being (buffer *))
|
|
|
|
|
|
|
| |
even 2 billion is way larger than even extreme operating values
expected for the members in base.h
include some structs directly in struct server, rather than by ptr
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
reduce code duplication in list resizing
realloc() of NULL ptr has behavior similar to malloc()
Note that if initial size == 0, then code used to adjust size
must be += x to ensure the size is non-zero for reallocation.
(Multiplying 0 * x, e.g. power-2 resizing, will result in 0.)
|
|
|
|
|
|
|
|
|
| |
quickly clear buffer instead of buffer_string_set_length(b, 0) or
buffer_reset(b). Avoids free() of large buffers about to be reused,
or buffers that are module-scoped, persistent, and reused.
(buffer_reset() should still be used with buffers in connection *con
when the data in the buffers is supplied by external, untrusted source)
|
|
|
|
|
|
|
|
|
| |
provide standard types in first.h instead of base.h
provide lighttpd types in base_decls.h instead of settings.h
reduce headers exposed by headers for core data structures
do not expose <pcre.h> or <stdlib.h> in headers
move stat_cache_entry to stat_cache.h
reduce use of "server.h" and "base.h" in headers
|
|
|
|
|
|
|
|
|
| |
centralize most waitpid() handling in core server, with hooks for
modules to be informed of pid and status when a process exits.
This enables faster discovery (and restart) of exited processes,
and also allows for lighttpd to manage backend processes in the
parent (master) process when server.max-worker > 0.
|
|
|
|
|
|
|
|
| |
If lighttpd is started privileged, then SSL/TLS modules need to be
initialized prior to chroot (optional) and prior to dropping privileges
in order to be able to read sensitive files such as private certificates
(thx m4t)
|
|
|
|
| |
remove exposure of stdio.h in buffer.h for print_backtrace(), now static
|
|
|
|
|
|
|
| |
handle_request_env (called on demand by handlers to populate env)
handle_connection_accept
handle_connection_shut_wr (was handle_connection_close)
handle_connection_close (now occurs at socket close())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lots of fixes and improvements
limitations: see comments at top of mod_deflate.c
missing functionality: encode streaming response
(module currently requires response be collected before being sent)
potential functionality: addition of compressed file cache would
allow mod_deflate to fully supplant mod_compress in lighttpd 1.4.x
x-ref:
"Adding mod_deflate to 1.4.xx"
https://redmine.lighttpd.net/issues/1824
"mod_deflate backport compile error if ENABLE_MMAP not defined"
https://redmine.lighttpd.net/issues/2753
github: closes #67
|
|
|
|
| |
thx joerg
|
|
|
|
|
|
|
| |
remove handle_joblist hook and remove the hooks defined in
mod_fastcgi and mod_scgi. The calls made to fdevent management
are redundant. If the calls were actually needed, then
mod_proxy would have needed a handle_joblist handler, too.
|
|
|
|
|
|
| |
From: Glenn Strauss <gstrauss@gluelogic.com>
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3113 152afb58-edef-0310-8abb-c4023f1b3aa9
|
|
|
|
|
|
| |
From: Stefan Bühler <stbuehler@web.de>
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3087 152afb58-edef-0310-8abb-c4023f1b3aa9
|
|
|
|
|
|
| |
From: Stefan Bühler <stbuehler@web.de>
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3072 152afb58-edef-0310-8abb-c4023f1b3aa9
|