Commit Graph

4294 Commits (3034147e5156da29f267c3839d21d591dce761b6)
 

Author SHA1 Message Date
Glenn Strauss 3034147e51 [tests] remove unused mod from tests/lighttpd.conf
remove unused module mod_userdir from tests/lighttpd.conf
(module is tested in src/t/test_mod_userdir.c)
2 years ago
Glenn Strauss 251f97bf4f [tests] t/test_mod_alias.c 2 years ago
Glenn Strauss 9b3fa6eb2b [tests] t/test_mod now runs all t/test_mod_*.c
combine into a single executable to reduce compilation/link redundancy
2 years ago
Glenn Strauss 05dc3d123a [core] better asm for binary num to ascii string
compiler optimizers generally convert div to an equivalent mul,
though not always optimally for modulus (%).  In places where
lighttpd is using both quotient and remainder, calculate the
remainder from the quotient.

x-ref: inspiration:
  https://lemire.me/blog/2019/02/08/faster-remainders-when-the-divisor-is-a-constant-beating-compilers-and-libdivide/
  https://lemire.me/blog/2019/02/20/more-fun-with-fast-remainders-when-the-divisor-is-a-constant/
2 years ago
Glenn Strauss 57c0859fd7 [core] uint_fast32_t tweaks
use uint_fast32_t in a few more places, where it yields better asm
2 years ago
Glenn Strauss 741513ecd1 [mod_ssi] merge mod_ssi_expr.c into mod_ssi.c
isolate this ancient relic
2 years ago
Glenn Strauss 457362cbe3 [mod_ssi] remove mod_ssi parser generator file 2 years ago
Glenn Strauss 43c5093a20 [mod_ssi] fix ancient bugs; replace cond parser 2 years ago
Glenn Strauss 0d9a8ed0aa [mod_ssi] 0-init ssi_val_t in ssi_ctx_t 2 years ago
Glenn Strauss adf2f816df [tests] mod_ssi tests moved to src/t/test_mod_ssi
remove mod_ssi Perl tests now performed by src/t/test_mod_ssi
2 years ago
Glenn Strauss 699209103c [core] use ck_assert() in vector.[ch] 2 years ago
Glenn Strauss be82f3d2e1 [doc] improve sample configs 2 years ago
Glenn Strauss 55d787cd55 [doc] expand vhosts.template 2 years ago
Istiak Ferdous 299220ac0d [doc] improve sample configs
(commit msg edited by gstrauss)
2 years ago
Glenn Strauss feb9b0c4a7 [core] fix removal of server.pid-file when testing (fixes #3115)
(thx dinoex)

fix removal of server.pid-file when testing config with lighttpd -tt
(regression in lighttpd 1.4.60, 1.4.61)

x-ref:
  "Test the configuration file while lighttpd is running."
  https://redmine.lighttpd.net/issues/3115
2 years ago
Glenn Strauss 9974b57aa5 [core] run plugin cleanup hooks in reverse
run plugin cleanup hooks in reverse to balance ctor/dtor-like plugin
behaviors
2 years ago
Glenn Strauss 8c7b86a316 [tests] reenable test_mod_ssi in cmake
(Instead, workaround added for libtool)
(There must be better ways to do this, but I don't know them right now)
2 years ago
Glenn Strauss d1f4bc98b9 [tests] disable test_mod_ssi in cmake (temporary)
disable test_mod_ssi in cmake (temporary) until include paths updated
or dependency added for the generated ssi parser header and impl
2 years ago
Glenn Strauss e93093422c [tests] disable test_mod_ssi in cmake (temporary)
disable test_mod_ssi in cmake (temporary) until include paths updated
or dependency added for the generated ssi parser header and impl
2 years ago
Glenn Strauss fe7d5a762d [core] libev EV_ERROR conflicts with kqueue
libev EV_ERROR conflicts with kqueue sys/event.h EV_ERROR
2 years ago
Glenn Strauss ec50657efe [mod_cgi] check fd-to-cgi not -1 before close
sanity check
2 years ago
Glenn Strauss 8b10f94c07 [core] warn if dynamic modules before mod_auth
warn if known dynamic modules listed before mod_auth in server.modules

e.g. mod_auth must be listed before mod_fastcgi in server.modules
     for fastcgi.server = ( "mode" => "authorizer" ) to work properly
2 years ago
Glenn Strauss 9cdb812c96 [core] use TCP_CORK w/ TLS if cq length > 16k
use TCP_CORK (on Linux) with TLS if cq length > 16k
2 years ago
Glenn Strauss b376934b67 [core] close backend socket fds more quickly
(thx ThomasDevoogdt)

close backend socket fds more quickly by polling with zero timeout when
there are pending fds scheduled to be closed after the next poll.

x-ref:
  "Slow request handling in Lighttpd 1.4.60"
  https://redmine.lighttpd.net/boards/2/topics/10063
2 years ago
Glenn Strauss 0f51b3728a [core] fdevent_fdnode.c separate from fdevent.c 2 years ago
Glenn Strauss 7113dcb49b [core] merge fdevent impls into fdevent_impl.c 2 years ago
Glenn Strauss ec52917755 [core] fdevent_impl.c separate from fdevent.c 2 years ago
Glenn Strauss b7a8fd468f [core] fdevent_socket_nb_cloexec_init()
fdevent_socket_nb_cloexec_init() separate from fdevent_init()
2 years ago
Glenn Strauss 84449e1497 [tests] t/test_mod_ssi 2 years ago
Glenn Strauss 98ba0310c4 [core] explicitly include sys/cdefs.h
<sys/cdefs.h> might not be included in standard headers by musl libc

x-ref:
  https://github.com/void-linux/void-packages/pull/33330/files#r725060227
  https://github.com/void-linux/void-packages/pull/33330/files#r725060227
2 years ago
Glenn Strauss c29268cd9e [core] remove redundant asserts
buffer_append_strftime() requires a non-NULL const string for format

buffer_append_string_encoded() and buffer_append_string_c_escaped()
both will handle encoding a 0-length string.  Since a 0-length string
is not expected, do not special-case it.  C type buffer_encoding_t
expects a constant value to be passed, so encoding map is not NULL.
2 years ago
Glenn Strauss 563eaea00d [core] 'struct log_error_st' -> 'log_error_st'
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
2 years ago
Glenn Strauss d361f9cca0 [core] clean up fdlog_st and log_error_st decls
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
2 years ago
Glenn Strauss 584a69c4ae [mod_alias] fix use-after-free bug (fixes #3114)
(thx LoneFox)

bug introduced in 62a874df in lighttpd 1.4.59

x-ref:
  "Use-after-free bug in mod_alias"
  https://redmine.lighttpd.net/issues/3114
2 years ago
Glenn Strauss 1540fdeab9 - next is 1.4.62 2 years ago
Glenn Strauss 3cf695d34b [doc] NEWS 2 years ago
Glenn Strauss e8eac0c2ad [core] chunkqueue_small_resp_optim() comment 2 years ago
Glenn Strauss 90f062cb07 [core] add HTTP/2 check resp finished w/ empty cq (#3111)
connection_handle_write_state() call to subrequest handler might set
r->resp_body_finished, but we need to check if r->write_queue is empty
before changing state from CON_STATE_WRITE to CON_STATE_RESPONSE_END

(If r->write_queue was already empty when the subrequest handler marked
 resp_body_finished, connection_state_machine_h2() could miss changing
 the request state to CON_STATE_RESPONSE_END)

x-ref:
  "HTTP/2 requests sometimes take very long (missing last chunk)"
  https://redmine.lighttpd.net/issues/3111
  "Slow request handling in Lighttpd 1.4.60"
  https://redmine.lighttpd.net/boards/2/topics/10063
2 years ago
Glenn Strauss ac9c9935a2 [multiple] add assert after malloc in two spots
add missing assert after malloc in two spots to detect malloc failure
(unlikely)
2 years ago
Glenn Strauss 7edb1956f3 [mod_auth] clear crypt() output if len >= 13
crypt() static output buffer is cleared upon next call to crypt(),
but clear output buffer anyway since next call to crypt() might be
much later.  Only clear crypt() output if length >= 13, since if
there is an error in crypt(), 'man crypt' warns:

"Some implementations of crypt, upon error, return an invalid hash that
is stored in a read-only location or only initialized once, which means
that it is only safe to erase the buffer pointed to by the crypt return
value if an error did not occur."
2 years ago
Glenn Strauss a067d99fa0 [core] chunkqueue_small_resp_optim if resp < 16k
(adjusted down from 32k after some basic benchmarking using weighttp)
2 years ago
Glenn Strauss 9a442b5555 [core] tighten chunkqueue_small_resp_optim() 2 years ago
Glenn Strauss 92cdf84951 [doc] uncomment mod_auth load in conf.d/auth.conf
uncomment mod_auth load in conf.d/auth.conf to match other conf.d/*
2 years ago
Glenn Strauss 41564a7e92 [core] tighten chunkqueue_mark_written; better asm
chunkqueue_mark_written() also removes finished chunks from beginning of
chunkqueue instead of separate call to chunkqueue_remove_finished_chunks
2 years ago
Glenn Strauss 3964a6ac39 [core] pwritev w/ chunkqueue_steal_with_tempfiles
use pwritev(), where available, with chunkqueue_steal_with_tempfiles()

The initial write to tempfiles (when response initially grows too
large in memory) can be multiple MEM_CHUNKs, so attempt to use
single pwritev() syscall
2 years ago
Glenn Strauss 5c18891a94 [build] check for preadv(), pwritev() 2 years ago
Glenn Strauss 907ec27737 [core] tighten chunkqueue_steal* code; better asm 2 years ago
Glenn Strauss 9466afd909 [core] remove redundant checks in same context 2 years ago
Glenn Strauss f71b048160 [multiple] warn deprecated mods slated for removal
issue warning to error log for deprecated modules slated for removal
2 years ago
Glenn Strauss fe055165d8 [mod_ajp13,mod_fastcgi] recv_parse smaller funcs
break *_recv_parse() into a pair of slightly smaller funcs
2 years ago