summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* [core] move some shared funcs to call from modulesGlenn Strauss2023-05-032-38/+40
| | | | (e.g. support for HTTP/2 module mod_h2)
* [meson] build fix for builtin_modsGlenn Strauss2023-05-031-2/+1
|
* [core] _WIN32 compile fixGlenn Strauss2023-05-031-1/+1
|
* [core] return pid_t from fdevent_waitpid()Glenn Strauss2023-05-034-7/+8
|
* [mod_mbedtls] check MBEDTLS_DEBUG_C for debug funcGlenn Strauss2023-05-031-0/+2
| | | | wrap mbedtls_debug_set_threshold() in #ifdef for MBEDTLS_DEBUG_C
* [core] always decr fd count upon socket close()Glenn Strauss2023-05-032-5/+5
| | | | | | | | | | | | | | 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.
* [mod_cgi] cgi_create_err() cold err handling funcGlenn Strauss2023-05-031-73/+64
| | | | | collect error handling code for cgi_create_env() (for code reuse and consistency; also reduces code size)
* [mod_cgi] do not issue trace if CGI closes inputGlenn Strauss2023-05-031-0/+8
| | | | It is not necessarily an error for CGI to close its input early
* [mod_cgi] reduce code sizeGlenn Strauss2023-05-031-9/+8
| | | | | | | .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)
* [mod_cgi] move fd count to cgi_create_env()Glenn Strauss2023-05-031-8/+5
|
* [core] rename http_kv funcs, reorder http_versionsGlenn Strauss2023-05-036-77/+48
| | | | | rename http_kv funcs for consistency ("http_" prefix) reorder http_versions[]
* [core] noinline stat_cache_sptree_find()Glenn Strauss2023-05-031-0/+1
|
* [mod_proxy] match "map-host-response" "-" w/ HostGlenn Strauss2023-05-031-1/+1
| | | | | | | match "map-host-response" with authority provided in (request) Host for "-" in response map and when no other "map-host-request" mapped request to a different authority. This is a bit friendlier for use with bidirectional https-remap.
* [TLS] $SERVER["socket"] inherit global ssl.engineGlenn Strauss2023-05-035-4/+33
| | | | | | | | | | | | | | | | | | $SERVER["socket"] inherits ssl.engine = "enable" from global scope fixes issue of TLS-enabled socket, but missing config, if ssl.engine = "enable" in global scope and $SERVER["socket"] does not contain ssl.engine = "enable" e.g. default TLS-enabled, and explicitly disabled on specific sockets server.port = 443 ssl.engine = "enable" ssl.pemfile = ... ssl.privkey = ... $SERVER["socket"] == ":80" { ssl.engine = "disable" } $SERVER["socket"] == "[::]:80" { ssl.engine = "disable" } $SERVER["socket"] == " :443" { } $SERVER["socket"] == "[::]:443" { }
* [core] noinline connection shutdown, resetGlenn Strauss2023-05-031-0/+5
| | | | | slightly reduces code size for less-hot code better collects shutdown process for r->http_version > HTTP_VERSION_1_1
* [core] h1.[ch] collect some HTTP/1.x specific codeGlenn Strauss2023-05-0311-935/+987
|
* [mod_auth] warn if auth.require path never matchesGlenn Strauss2023-05-031-0/+12
| | | | warn if auth.require path never matches due to an earlier, shorter path
* [meson] check FORCE_{WOLFSSL,MBEDTLS}_CRYPTOGlenn Strauss2023-05-031-3/+7
| | | | | | | check FORCE_WOLFSSL_CRYPTO and FORCE_MBEDTLS_CRYPTO when choosing cryptolib todo: should also apply to lighttpd autoconf, CMake, SCONS builds
* [mod_cgi] comment about caching target dirnameGlenn Strauss2023-05-031-0/+17
| | | | | | | comment code about caching target dirname using stat_cache In simple performance tests, using stat_cache here makes little difference, as the overhead of process creation is orders of magnitude larger.
* [core] use posix_spawn() where availableGlenn Strauss2023-05-034-1/+108
| | | | | | | | | | | | | | | | | | | | | | | | | use posix_spawn() where available use posix_spawn_file_actions_addfchdir_np() where available Using posix_spawn() reduces initial execution overhead of CGI programs; posix_spawn() is often faster than application code wrapping and calling traditional fork(),execve(). (history: fdevent.c posix_spawn code based on fdio.c:fdio_ipc_spawn() from 2015 on one of my unpublished branches. The inability to chdir() delayed inclusion in lighttpd, as the CGI specification says: "The current working directory for the script SHOULD be set to the directory containing the script." e.g. chdir() to target program directory before CGI execution) posix_spawn_file_actions_addfchdir_np() is a new(er) extension supported in glibc 2.29+, musl libc, FreeBSD ≥ 13.1, macOS ≥ 10.15 according to https://cygwin.com/pipermail/cygwin/2023-April/253505.html https://cygwin.com/pipermail/cygwin/2023-April/253526.html https://sourceware.org/bugzilla/show_bug.cgi?id=17405 POSIX Issue 8 plans to include posix_spawn_file_actions_addfchdir(): https://www.austingroupbugs.net/view.php?id=1208
* [build] _WIN32 shared dll build (autotools, cmake)Glenn Strauss2023-05-0310-3/+41
| | | | | | | | | | | | | | | | | | | | | There are likely better and cleaner ways to do this; patches welcome. _WIN32 symbol imports and exports MS Visual Studio (_MSC_VER) does not appear to export global data symbols even when exporting all functions. Annotating any symbols with __declspec(dllexport) in any translation unit appears to change default dll symbol implict export behavior. Currently, src/Makefile.am and CMakeLists.txt take different approaches (implib versus linking against executable which has exported symbols) x-ref: (improved solutions might possibly be constructed using these docs) https://sourceware.org/binutils/docs/ld/WIN32.html https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html https://stackoverflow.com/questions/225432/export-all-symbols-when-creating-a-dll
* [build] _WIN32 __declspec(dllexport) *_plugin_initGlenn Strauss2023-05-0349-0/+65
| | | | _WIN32 __declspec(dllexport) on mod_*_plugin_init()
* [meson] static build option under cygwinGlenn Strauss2023-05-031-25/+43
| | | | | | - static build option under cygwin - _WIN32 build more modules with BUILD_STATIC - _WIN32 remove older build config
* [core] _WIN32 use WSASend for writev-equiv on sockGlenn Strauss2023-05-031-0/+18
| | | | https://learn.microsoft.com/en-us/windows/win32/winsock/scatter-gather-i-o-2
* [cmake] _WIN32 remove older build configGlenn Strauss2023-05-031-8/+0
| | | | (e.g. LI_DECLARE_EXPORTS is not currently used)
* [cmake] _WIN32 build more mods with BUILD_STATICGlenn Strauss2023-05-031-0/+30
|
* [core] _WIN32 scream UTF-8 at MS (does not matter)Glenn Strauss2023-05-031-0/+12
| | | | | alas, does not seem to make a difference; across many core interfaces, MS handles non-ASCII UTF-8 poorly
* [core] _WIN32 custom fs funcs on UTF-8 pathsGlenn Strauss2023-05-037-21/+148
| | | | | | | | | | | open(), stat(), mkdir() on UTF-8 paths lighttpd provides large file support and 64-bit time, so provide override to use _stati64() (and _wstati64()) Additionally, provide custom function to support stat on UTF-8 path, which must first be converted to wide-char and _wstati64(), since _stati64() is naive and does not properly support UTF-8.
* [core] _WIN32 lighttpd winsvcGlenn Strauss2023-05-033-25/+360
|
* [core] _WIN32 prefer WSAPoll()Glenn Strauss2023-05-031-3/+1
| | | | | | | | | | | | Note: TCP half-close is reported by WSAPoll() as POLLHUP event. (e.g. TCP half-close from shutdown(fd, SHUT_WR)) TODO: If performance tests of select() vs WSAPoll() do not show a a measurable difference, select() may be preferred over WSAPoll(). For now, make both "poll" and "select" available options in _WIN32. (On other platforms, lighttpd build does not built code to use select() when poll() is available on the platform.)
* [core] _WIN32 close chunk temp files before unlinkGlenn Strauss2023-05-031-0/+6
|
* [tests] _WIN32 close files before unlinkGlenn Strauss2023-05-033-8/+17
| | | | Also, adjust mod_ssi to remove assumption that "/tmp" is temp directory
* [mod_dirlisting] _WIN32 close files before unlinkGlenn Strauss2023-05-031-7/+9
|
* [mod_deflate] _WIN32 disable deflate.cache-dirGlenn Strauss2023-05-031-0/+6
| | | | | | | | _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.
* [tests] _WIN32 cygwin test supportGlenn Strauss2023-05-032-2/+35
|
* [core] _WIN32 stat(), '/' and '\\' adjustmentsGlenn Strauss2023-05-034-8/+41
| | | | The adjustments are minimal; not intended to be complete.
* [multiple] _WIN32 use fdevent_kill()Glenn Strauss2023-05-032-18/+5
|
* [core] _WIN32 fdevent_kill()Glenn Strauss2023-05-033-2/+35
|
* [core] _WIN32 use rand_s() to init pseudo RNGGlenn Strauss2023-05-031-0/+22
|
* [core] _WIN32 use log_serror() for WSAGetLastErrorGlenn Strauss2023-05-037-43/+44
|
* [core] _WIN32 log_serror() for WSAGetLastError()Glenn Strauss2023-05-032-0/+27
|
* [core] _WIN32 log_perror() with GetLastError()Glenn Strauss2023-05-032-17/+31
|
* [core] _WIN32 reset std streams at startupGlenn Strauss2023-05-033-1/+48
|
* [multiple] __MINGW32__ missing strftime() "%F %T"Glenn Strauss2023-05-037-1/+39
| | | | mingw does not support strftime() "%F %T"
* [build] _WIN32 mingw buildGlenn Strauss2023-05-034-6/+18
| | | | use -lws2_32 instead of -lwsock32
* [tests] _WIN32 use TMPDIR (or TEMP) for test filesGlenn Strauss2023-05-033-27/+71
|
* [core] _WIN32 casts to quiet some VS warningsGlenn Strauss2023-05-032-1/+5
|
* [core] _WIN32 rename __WIN32 to _WIN32Glenn Strauss2023-05-038-16/+16
|
* [core] _WIN32 basic (very limited) getopt() implGlenn Strauss2023-05-031-1/+63
|
* [core] _WIN32 alternative fdarray for WindowsGlenn Strauss2023-05-036-10/+131
| | | | | | | | | | | | | | | | | | | _WIN32 SOCKET (long long unsigned) handles are assigned differently from how POSIX allocates file descriptors (lowest number available). On _WIN32, the SOCKET descriptor should not be used to index an array of (fdnode *), so this commit provides an alternative method to store (fdnode *) for use by select() and by WSAPoll(). select(): commonly used unix select() idioms may be incorrect on _WIN32 https://devblogs.microsoft.com/oldnewthing/20221102-00/?p=107343 https://devblogs.microsoft.com/oldnewthing/20161221-00/?p=94985 WSAPoll(): https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsapoll As of Windows 10 version 2004, when a TCP socket fails to connect, (POLLHUP | POLLERR | POLLWRNORM) is indicated. (note: this was broken in WSAPoll() in all earlier Windows versions)