Commit Graph

5089 Commits

Author SHA1 Message Date
Glenn Strauss 532a3c06bc [core] provide mimetype.assign default if unset
provide mimetype.assign default with basic values if config is unset
2023-05-23 00:48:43 -04:00
Glenn Strauss 29d5a4669b [core] use empty value in srvconf.config_touched 2023-05-23 00:44:57 -04:00
Glenn Strauss e97a74f4b3 [core] update ls-hpack
LiteSpeed ls-hpack v2.3.2

(plus subsequent ls-hpack bugfix for cast to lsxpack_offset_t)
2023-05-22 22:28:52 -04:00
Glenn Strauss 7513815053 [core] preproc consistency #pragma GCC diagnostic
ls-hpack/lshpack.c preprocessor consistency with #pragma GCC diagnostic
2023-05-22 22:10:27 -04:00
Glenn Strauss 28edc8d3c9 [core] server.modules s/mod_compress/mod_deflate/
replace mod_compress with mod_deflate in server.modules

mod_deflate is special-cased to not error out if module fails to load
(if missing, everything else continues to work without deflate feature)
2023-05-22 01:59:22 -04:00
Glenn Strauss cc235fda39 [multiple] remove some unused/redundant includes 2023-05-21 20:00:22 -04:00
Glenn Strauss 6996ddd32e [core] request_init() separate static func 2023-05-21 16:31:57 -04:00
Glenn Strauss 89db6303f4 [core] fix crash due to missing initialization (fixes #3207)
(thx ultimator)

fix crash due to missing re-initialization of reused r->dst_addr_buf

  "Segfaults after upgrade to version 1.4.70"
2023-05-21 13:20:27 -04:00
Glenn Strauss 661905adf4 [core] compile w/o posix_spawn() on iOS
iOS does not allow subprocess creation; compile w/o posix_spawn() on iOS
2023-05-18 23:36:33 -04:00
Glenn Strauss b6c99696ba [core] quiet lemon.c clang C2x warnings 2023-05-15 01:23:53 -04:00
Glenn Strauss a14a93e1fa [core] check getaddrinfo EAI_ADDRFAMILY w/ glibc
check getaddrinfo() error EAI_ADDRFAMILY only with __GLIBC__ defined

  "www/lighttpd: fix listening on IPv6 and IPv4 addresses"
2023-05-14 22:32:20 -04:00
Glenn Strauss e05a9354a3 [core] _WIN32 quiet compiler warnings 32-bit build 2023-05-13 04:44:55 -04:00
Glenn Strauss 5ce791cd57 [core] fix new use of posix_spawn with some glibc (fixes #3201)
(thx fstelzer)

adjust optimization to fix use of posix_spawn() with some glibc vers,
as older versions rejected sigaction() SIG_DFL on some signals including
SIGKILL, SIGSTOP, and bits in signal mask set higher than NSIG

  "include_shell not working on all platforms"
2023-05-11 19:00:03 -04:00
Glenn Strauss 42314fdc02 [mod_magnet] fix static build using autoconf (fixes #3203)
(thx desmana)

missing algo_hmac.c from static build
(since removal of mod_secdownload in lighttpd 1.4.68)

  "static build fails due to missing algo_hmac"
2023-05-11 12:36:24 -04:00
Glenn Strauss 2892a7bf3f [mod_h2] HTTP/2 separate module; no longer builtin
HTTP/2 separate module; no longer built-in to lighttpd executable
2023-05-10 19:06:42 -04:00
Glenn Strauss b9ff4ef9bf - next is 1.4.71 2023-05-10 17:43:48 -04:00
Glenn Strauss c223201bb2 [core] treat mod_h2 as built-in module (for now)
(addendum to previous commit)
(lighttpd test confs set server.compat-module-load = "disable")

Note: a future release of lighttpd will build mod_h2 as a separate
module (not built-in) when lighttpd is built with shared modules (.so)
2023-05-10 03:03:28 -04:00
Glenn Strauss 0ed99f4fe6 [core] treat mod_h2 as built-in module (for now)
(addendum to previous commit)
(lighttpd test confs set server.compat-module-load = "disable")

Note: a future release of lighttpd will build mod_h2 as a separate
module (not built-in) when lighttpd is built with shared modules (.so)
2023-05-10 02:48:13 -04:00
Glenn Strauss 1196dd727d [doc] NEWS 2023-05-10 02:09:18 -04:00
Glenn Strauss e02cb38c87 [core] treat mod_h2 as built-in module (for now)
Note: a future release of lighttpd will build mod_h2 as a separate
module (not built-in) when lighttpd is built with shared modules (.so)
2023-05-10 02:08:28 -04:00
Glenn Strauss eed82eb335 [tests] tests/ comment w/ alt build root
tests will fail to run from an alternate build root on platforms
on which cp -n is not supported, such as NetBSD and OpenBSD
2023-05-10 02:08:25 -04:00
Glenn Strauss 7f3f9001d5 [core] fdevent_load_file() check if limit exceeded
currently used w/ power-2 limit values, but add check >= if not power-2
2023-05-09 21:07:39 -04:00
Glenn Strauss 37abf67b51 [mod_dirlisting] _WIN32 compile fix 2023-05-08 04:10:40 -04:00
Glenn Strauss 701eb0a0ca [core] modify use of posix_spawnattr_setsigdefault
modify use of posix_spawnattr_setsigdefault() on __linux__

Subprocesses (CGI scripts and backends FastCGI, SCGI, proxy, etc)
which spawned their own children and accidentally relied on inheriting
SA_RESTART on SIGCHLD from lighttpd will now have to set that flag
themselves, if desired.

From a quick survey:
- bash sets SA_RESTART on SIGCHLD.
- Perl and Python unconditionally reset signals.
  (Other interpreters are expected to do so as well.)
2023-05-08 03:52:42 -04:00
Glenn Strauss c2349f149f [core] Mac OS POSIX_SPAWN_CLOEXEC_DEFAULT
use Mac OS POSIX_SPAWN_CLOEXEC_DEFAULT where available
2023-05-08 01:01:58 -04:00
Glenn Strauss 61dc9affb7 [core] posix_spawn_file_actions_addclosefrom_np()
use posix_spawn_file_actions_addclosefrom_np() where available
2023-05-08 01:01:26 -04:00
Glenn Strauss 9f0b30b5ca [core] posix_spawnattr_setcwd_np() on QNX
use posix_spawnattr_setcwd_np() (QNX Neutrino 7.1 or later)

NOTE: HAVE_POSIX_SPAWNATTR_SETCWD_NP *is not* currently checked and set
in the builds, so must be manually defined for build in order to enable.
2023-05-07 20:47:51 -04:00
Glenn Strauss ab182987fe [mod_openssl] check kernel support for KTLS
limit KTLS attempts to linux kernel version >= 4.17
or to FreeBSD 13 and kern.ipc.tls.enable

(avoid setsockopt() if KTLS is not enabled in running kernel)
2023-05-07 11:32:06 -04:00
Glenn Strauss 607057dd9e [core] fix HTTP/2 use of http_response_loop()
(bug recently reached master branch; not released)
2023-05-07 03:29:42 -04:00
Glenn Strauss bdfbcbf233 [mod_openssl] FreeBSD: check "kern.ipc.tls.enable"
FreeBSD: check sysctl "kern.ipc.tls.enable" before attempting KTLS
(avoid setsockopt() if KTLS is not enabled in running FreeBSD kernel)
2023-05-07 03:00:31 -04:00
Glenn Strauss 14fe46f09e [core] quiet coverity warning 2023-05-05 01:22:36 -04:00
Glenn Strauss 1417ca79f8 [mod_dirlisting] _WIN32 fix fstat() after close()
fix fstat() after close(); revert part of 699e0e46

(bug on master branch; not released) (found by coverity static analysis)
2023-05-05 01:21:15 -04:00
Glenn Strauss 082eb8a4f8 [mod_openssl] SSL_OP_ENABLE_KTLS_TX_ZEROCOPY_SENDFILE
2023-05-05 00:50:10 -04:00
Glenn Strauss fa26bf072a [build] ifdef _WIN32 before include fs_win32.h
revert previous commit adding fs_win32.h to hdrs

ifdef _WIN32 check before include fs_win32.h so that other platforms
do not have to care
2023-05-04 01:14:06 -04:00
Glenn Strauss b19efdf128 [autoconf] include fs_win32.h in hdrs for dpkg 2023-05-04 01:10:44 -04:00
Glenn Strauss d0338dbbed [scons] avoid dup mod_h2 module in static build 2023-05-04 00:53:19 -04:00
Glenn Strauss 1295dd4389 [tests] copy confs for running tests in alt dir
copy tests/*.conf for running tests in alternative build dir
2023-05-04 00:38:29 -04:00
Glenn Strauss 0ce53275de [mod_cgi] reset upload_temp_file_size in CGI close
reset upload_temp_file_size in cgi_connection_close if p->tempfile_accum
2023-05-03 23:11:35 -04:00
Glenn Strauss 424d7d99b3 [mod_cgi] reuse fd already opened to /dev/null
lighttpd STDIN_FILENO is reopened to /dev/null at server startup

Let CGI inherit fd STDIN_FILENO when (0 == r->reqbody_length)
2023-05-03 23:11:35 -04:00
Glenn Strauss c3710a8bff [mod_cgi] doubly-linked list of CGI pids
(issue in lighttpd 1.4.60 - 1.4.69)
2023-05-03 23:11:35 -04:00
Glenn Strauss 996fc6b473 [build] move some files to call from modules
(e.g. support for HTTP/2 module mod_h2)
2023-05-03 23:11:35 -04:00
Glenn Strauss c06898cb84 [core] move some shared funcs to call from modules
(e.g. support for HTTP/2 module mod_h2)
2023-05-03 23:11:35 -04:00
Glenn Strauss 104dd2f987 [meson] build fix for builtin_mods 2023-05-03 23:11:35 -04:00
Glenn Strauss 1ce869402f [core] _WIN32 compile fix 2023-05-03 23:11:35 -04:00
Glenn Strauss b5d4f86fe4 [core] return pid_t from fdevent_waitpid() 2023-05-03 23:11:35 -04:00
Glenn Strauss 0d0f785230 [mod_mbedtls] check MBEDTLS_DEBUG_C for debug func
wrap mbedtls_debug_set_threshold() in #ifdef for MBEDTLS_DEBUG_C
2023-05-03 23:11:35 -04:00
Glenn Strauss 99f03a2bce [core] always decr fd count upon socket close()
always decr fd count in connection_close()
always decr fd count in fdevent_sched_run()

Error return value from close() should be used for diagnostics and
recovery, but the state of the file descriptor is unspecified by POSIX.
On most systems, it is invalid to redo close().  (Linux 'man 2 close'
suggests that HP-UX is an outlier, and that a future POSIX standard
update will specify the behavior for the file descriptor to be closed)

EBADF should not happen in those funcs for lighttpd since those should
be the only locations in lighttpd where those fds are closed.
2023-05-03 23:11:35 -04:00
Glenn Strauss 7381c119ed [mod_cgi] cgi_create_err() cold err handling func
collect error handling code for cgi_create_env()
(for code reuse and consistency; also reduces code size)
2023-05-03 23:11:35 -04:00
Glenn Strauss ddfcc89714 [mod_cgi] do not issue trace if CGI closes input
It is not necessarily an error for CGI to close its input early
2023-05-03 23:11:35 -04:00
Glenn Strauss 2f472ddccc [mod_cgi] reduce code size
.text segment was slightly over (2) 4k pages;
tweak code to be slightly less than (2) 4k pages
(when compiled optimized -O2)
(likely smaller when compiled -Os)
2023-05-03 23:11:35 -04:00